Creating Charts Dynamically in SSRS
Hi Guys, I have this unique requirement where I have to create charts dynamically at runtime through c# code in a rdl file. Then all these charts will be displayed to users through the Report Viewer control. I know that rdl file is nothing but a XML file and using the LINQ to XML i can put dynamic XML related to the charts inside the rdl file but can I do this is the rdl file itself instead of putting all my logic in the c# file. zeeshan [ visit my forum: www.code4project.com ] [visit my blog: www.geekswithblogs.net/zeeshanjan]
May 20th, 2010 11:22am

you can do it provided you write the code in the form of an expression for visibility: in the properties section or if you are talking based on the data, you need to dynamically display the chart. then you can try the code section of the report to insert your code where i usually use vb. i think c# should work fine. but my suggestion is that direct code is efficient than putting your code in the rdl. let me know if i am not clear. mark as answer if this solves your post.
Free Windows Admin Tool Kit Click here and download it now
May 20th, 2010 4:43pm

you can add a parameter to the report, and then pass the parameter when invoking the reportviewer control from C#; in that way charts will be dynamically recreated for each parameterJavier Guillen
May 20th, 2010 4:54pm

Hi Guys, Thanks for your answers. I was able to solve it. My requirement was to have a feature where I can divide one chart in SSRS into multiple charts. I have done this by creating rdlc file dynamically.I received data in the form of dataset which is nothing but a table. Then I divided the entire table into set of tables and bound each chart with a table. As the rdlc file is nothing but a xml file. We can make as many changes as we want in it. Thanks.zeeshan [ visit my forum: www.code4project.com ] [visit my blog: www.geekswithblogs.net/zeeshanjan]
Free Windows Admin Tool Kit Click here and download it now
June 10th, 2010 9:12am

Hello Zeeshan, I'm trying to to come up with similar solution, Do you have some sample code I can view/use to get me started? Everette,
September 10th, 2011 1:28pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics