Visio Guy

Visio Discussions => Programming & Code => Topic started by: hill041 on September 03, 2018, 08:54:17 PM

Title: Automatic Report Running
Post by: hill041 on September 03, 2018, 08:54:17 PM
Hey,

Does anyone know if it's possible to automate the running of specific reports?

I've exported a report file and now I want to make a button on a ribbon within an add on that will run it.

I've been using Nikolay's excellent extender for VS (http://unmanagedvisio.com/tools/visual-studio-project-templates-to-create-visio-add-ins/) to package my template and stencil so far but haven't made a button yet.

Does anyone have any ideas on if this is possible and any tips on what code could do this please?

Dan.
Title: Re: Automatic Report Running
Post by: Gustavo on September 04, 2018, 06:47:46 AM
Hi Dan. In my solution I had to put the report definition file (*.vrd) in the \3082 folder in the installed Visio 2013 x64 folder (C:\ProgramFiles\Microsoft Office\Office15\3082), and I called with a sub


Sub Rep_RP_01i(control As IRibbonControl)  'Run RP_01-i report.
Visio.Application.Addons("VisRpt").Run ("/rptDefName=RP_01-i.vrd /rptOutput=EXCEL")
End Sub


Name of the report file shouldnt be very long.

Regards
Title: Re: Automatic Report Running
Post by: Nikolay on September 04, 2018, 11:03:38 AM
That mentioned setup project support only add-ins (COM/VSTO), templates, stencils, and help files..
All of these can be "registered" (published) for Visio (i.e. basically acts as a replacement for the "solution publishing tool")

I don't think that any registration is needed (or exists) for the .VRD files. Probably you could just put them to the user's computer. Although I'm not really sure   :-[
Title: Re: Automatic Report Running
Post by: hill041 on January 15, 2019, 11:39:03 AM
Thanks for the attempts guys. I've ended up issuing the report file separately. Its not ideal but its worked so far. Cheers.