How to Programmatically Add .rdl Files in the SSRS Reporting Project? - reporting-services

I have a Visual Studio 2019 project that I made using Report Server Project Wizard. In this project, I import reports (.rdl) files from a different report server project. To add a report, I right click on the project in the solution explorer and do Add > Existing Item and then choose the .rdl file and then it gets included in the project. Is there any way to include the reports (.rdl) files programmatically in the project? For example, can I create a C# console app to copy (.rdl) files from one report server project and then actually add them into a different report server project. Simple copying and pasting .rdl files from one project to another is not working - the file even after it is pasted doesn't show up in the project.
I have tried using EnvDTE to access the solution and project objects, but all the online sources, such as this - https://flylib.com/books/en/3.50.1.50/1/, that provide info on EnvDTE have example code written in VB and it shows you how to create a new solution and project objects and then add a file. What I want is programmatically access the object of the current(existing) report server project and somehow programmatically add .rdl files from another folder into this project. Is that possible?
Thanks

Unless you have hundreds of projects, I can't see the point of building something that is pretty easy to do anyway. You can select multiple files when you do "Add Existing Item".
Having said that, all you need to do is copy the file to the target project folder and then add an entry into the project file in an item group
e.g.
<ItemGroup>
<Report Include="My First Report.rdl" />
<Report Include="My Second Report.rdl" />
<ItemGroup>
You could probably get away with processing this as a simple text file.

Related

How to publish html report inside VSTS

I have a simple batch (let's call it run_job.bat) job that I set up in VSTS as release definition. VSTS reads this file from the remote git repository that is also set up in VSTS.
The agent is configured on a remote machine to access certain folder, say C:\AllScans\FolderWhereScanIsRunning\ bring the necessary batch file in there and start the run. The job runs some scan against web application and generates report file with some unknown for me extension.
Another job then runs as queue in VSTS (let's call it run_report.bat) that transforms this unckown file to zip file where .html, .css and .js files are sitting. Simply exporting this manually to another folder and double clicking on the index.html file shows nicely looking html report on how the scan is run, and if there were any failures during it.
My question: is it possible to access this zip file C:\AllScans\FolderWhereScanIsRunning\report.zip, unzip it and bring this index.html file within the VSTS UI? I want be able for my other coworkers to see the results of the scan in html format without leaving VSTS interface? Thanks for the help
There isn't any way to achieve this by default.
A workaround would be deploy the html files to a web page which allow iframe embedding and then use "Embedded Webpage" widget in VSTS to show the content.

How to Create Embedded Data Source in SSRS 2014

I want to create embedded data source in SSRS 2014 using Visual studio 2013. But there is no item for embedded data source. How I can add it?
Thanks
You create an Embedded Data Source in the report itself, not in the project.
Create a new report in your project (or use an existing one). Then, in the Report Data pane Ctrl+Alt+D, create a new Data Source by right-clicking on the Data Sources folder.
Choose Embedded connection, the Type and populate the Connection String with the settings that are appropriate for connecting to your database.
Afterward, add a new dataset by right-clicking on the Datasets folder and choosing Add dataset. Choose Use a dataset embedded in my report, and pick the data source you created above.
The report will use that embedded connection going forward, at least for this dataset.

Is it possible to export/import Project.params within SSIS?

Does SSIS 2012 allow to export settings of a project located into Project.params for a further import into another project?
You can simply copy and replace the Project.params file in your new project with the file from the existing project. This obviously overwrites any existing project parameters. If you have need, you can patch the two XML files together just add/remove SSIS:Parameter tags as required.

Print MS Access report to .xps file using VBA

I am using MS Access 2003 and have seven different reports I have to distribute each morning, and I currently do that manually by printing each to an XPS file. The default printer for each report has been set to XPS file, and I tried this code:
DoCmd.OpenReport ("rptDaily_1of7")
DoCmd.PrintOut acPrintAll,1,,acHigh,1
When I use that, it does open a Save As box, but .tif is the only option in the "Save As type" field. Even if it wasn't though, ideally I'd like to send the file path and name as a parameter and have it handle the entire process (so I can use a loop to generate all seven files with the push of a button). I'm hoping there's another command I can use to do this, or possibly another method. Note that it's not my machine, and I do not have admin rights to install anything else (like a pdf generator, etc.).
You can create your reports as PDF files using ReportToPDF by Stephen Lebans.
This can be easily automated (there is a MDB with example code in the download) and you don't have to install anything.
It comes with two DLLs which you need to put into the same folder as your MDB/MDE, and that's it. No installation / DLL registering, just distribute the two DLLs with your MDB/MDE.
We are using this at work to print thousands of reports per day from Access 2003.

SSRS 2008: How to define Table/Tablix style without using a wizard?

Or how do I change the Table (Tablix) style in an already existing Report Server Project?
(I'm talking about a style which can be set in Report Server Project Wizard)
The style selected as a step in the Report wizard sets many properties on individual items in the report. Once created there is no easy way to switch a report from one style to another.
Two options:
Recreate the report using the wizard and select the new style.
Create two reports using a simple dataset, and then compare the resulting .rdl file (XML) in a file compare utility, such as UltraCompare. This will give you a list of all the different properties.
The file used for the style templates is at
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Business Intelligence Wizards\Reports\Styles\en\StyleTemplates.xml in my installation of BIDS.
Examining this file can show you the changed properties as well.