How to design report at run time SSRS - c#

most of the time we point store procedure or table and then SSRS report designer show us field and we just drag drop those field on to report designer surface. after all we call those report programmatically and pass parameter and report shown on report viewer.
now my company want that customer will customize the report who will see the report. they want to display all the fields in a form and just customer will select each field and place on report designer surface and give some input like filter condition like date range or employee id etc and report will be shown. also at run time if customer want they can add text or move existing field etc.
i do not have any idea how could i do this with SSRS. if this is possible with SSRS then please guide me in such a way as a result i can start the job or if possible give me few relevant url of that kind from where i can get the idea. thanks

SSRS is capable of reading reports generated on-the-fly, but they have to be made just right. SSRS reports are XML documents that specify the data structure and report object structures and how the two are related. Using Visual Studio, you can use certain classes to create the XML document which is then read & filled with data on the server, then exported to the client as a standard webpage.
Here is a link to a tutorial. This should be a good starting point.

Here is a small but working example of generating RDL on-the-fly with some useful links to MSDN documentation: "How to dynamically generate SSRS Report in Code"
Hope it helps!

Related

Matrix in report designer using parameter as data source

I have a big amount of data in a windows form c# application, and i want to generate a report with it. I don't want the report to access the database directly.
The report must have a list of orders (rows), a list of products (columns), and the amount of each product in each order (body). As i said, i have all that information in c#, and i want to put it in the report.
I've tried to use telerik report designer as well, with no result.
Is there any way to use a dataset in c# as datasource of the matrix?

Table with multiple sub table in .rdlc report in C#

I am working on window application in Visual Studio (C#). I want to create a dynamic report in c# using .rdlc report. And i want to generate table with multiple sub tables in it as per requirement or filter in report (something like in grid view). I attached a sample image. I want to generate report like as report in attached image. Please provide me some suggestion how can I do this.
Report Format
You can achieve this either by grouping your data or with subreports. I would recommend grouping.
Here are two MSDN links that can help you:
Create a Stepped Report
Add a Subreport and Parameters

Print multiple copies of the same RDLC report

I have a RDLC reports that print some data based on a certain query. What I'm trying to do now is to print the same report (with different data based on a different value for the primary key) multiple time without having different files to print.
Let's say I have 3 reports of 2 pages each, I want a single report of 6 pages.
I used to do that in Crystal Report XI simply by putting a group on my primary key but I haven't been able to replicate that in Visual Studio Report Designer.
I need a preview is possibile so I can't just print them one after another.
You could make a combined report that loads the three reports as subreports. There's loads of useful information at gotreportviewer.com/subreports. It's easy if the three different reports are in three different .rdlc files. The situation is slightly more complicated when you want to use the same .rldc file for more than one subreport in the same combined report. A subreport has parameters passed to it, and gets its DataSet through the SubreportProcessing event handler. The solution I came up with was to pass a ReportID parameter to the subreport; then, the SubreportProcessing event handler asks what the ReportID is, and passes back the DataSet appropriate for the report.
You may need to modify your reports slightly to make them work as both "main" reports and subreports. Subreports don't print the header or footer, so if you had important data there you'll need to move that to the body of the report. Also if you use the ReportID trick, then you may need to modify the report to take the ReportID parameter.
Good luck!
After some digging I actually solved my issue using PdfSharp.
It works wonderfully for me because I don't need multiple rdlc files, I just do a loop and then export all to pdf.

SSRS export report using C#

I want to ask is there any way to export SSRS report programmatic using C#
Export through ssrs report using C# When reports Run it should save on local disk
Please see the image screen shot
enter image description here
Like i dont want to export like this as above screen shot...
i want it like when report click it should be export or save in local disk
is there any code then please help me
Yes you can. Search for "ReportExecutionService SSRS C#". You can then just specify whether you want Excel or PDF in the line ".Render(format, ...."
An example can be found at http://www.aspose.com/docs/display/wordsreportingservices/rendering+reports+programmatically
If you want to automatically save the report when you display it with the Report Manager website, then it is not possible.
You create a client/web application and use the Reporting Services Web Service (here are the supported formats) to render the report, but you wouldn't be able to trigger your application from the Report Manager.
If your users really need to display and save the report at the same time, then you could use ReportViewer controls in your application and add some code to save the report automatically when the user display a report.
It would fit your needs but will take some time to develop, because you will need to redevelop a "report explorer" to browse in the different folders if you need to have the same user experience.

Single Object as datasource for report viewer

I am having some trouble with Report Viewer and RDLC files.
I have never before worked with any of these so I am still learning. I am looking for a guide to do the following.
I want to generate a report from a single object, ie. I have a list of objects and I want to pass say the first object to the report and then display the data contained in the properties of that object.
So basically I have a form which is completed and saved into my database, I have a custom object that stores the data captured in the form. I then want to click save and generate. This I then want to generate the report from the data captured on the page.
Any advise and guides would be appreciated.
I already have a xsd file generated from my object that I use as the dataset, I want to now supply the data.
It's very simple, but it's too long to write all the passages.
In short, you have to:
Create your RDLC file from the report designer
Bind your RDLC file with the DataSet you have
(Option) Bind your report with the ReportViewer to show it on your webpage
The third passage is optional because you can also write code to render directly your report and put it in download as pdf file (or excel).
This blog's post explain a lot of passages so just have a look at it.
There is also the famousgotreportviewer website but it's a bit outdated (still has good examples)

Categories