Populating different types of charts dynamically

Posted on 2007-10-08
Medium Priority
Last Modified: 2011-10-03
My application stores the chart details like Title, Number of the charts, type of each chart, etc. onto a database table. For example,
Number of Charts : 2
Chart - 1 Title  :  Efficiency Comparison
Chart - 1 Type : Bar chart
Chart - 2 Title  :  Sector Allocation
Chart - 1 Type : Pie chart

At the time of report generation, it should be able to identify the type of the chart to draw, and the appropriate chart should be displayed. For example,
             Efficiency Comparison                             Sector Allocation
                   (Bar Chart)                                            (Pie Chart)

Question by:Yogeshup
LVL 10

Expert Comment

ID: 20032808
 str = "SELECT QUERY [select title and type of chart] FROM [tablename]"

                DropDownList1.DataSource = [connectionstring]
                DropDownList1.DataTextField = "title"
                DropDownList1.DataValueField = "type"

Then based on TYPE [in DataValueField], you can display different charts.
LVL 42

Expert Comment

ID: 20033141
Are you trying to have crystal create a chart dynamically at runtime?  Afaik the object model doesn't support this.  You could create a report with different types of charts on it already and then conditionally suppress them at runtime so only the ones you need are visible.

LVL 23

Expert Comment

by:Ido Millet
ID: 20033308
Use a parameter to pass into the report the choice of which chart should be visible.

Use the parameter in the suppress attribute expression of the chart or of the section within which it is placed to control which chart or section is visible.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 20046617
Hi Frodomam / IdoMillet,
From your comments, i noticed that you have misunderstood my requirement. That is, you have thought based on one particular type of chart, the report will be generated dynamically with that chart type - by passing the chart type as a parameter, suppressing the sub-report. etc.

But, my requirement is, i can have 'N' number of charts in the report created dynamically with appropriate chart-types. Hence, there can be a possibility of 4 pie charts in the same report or all different charts in a report, etc.

Please advise us.
LVL 42

Expert Comment

ID: 20047449
Perhaps I'm still not understanding but let me respond this way:

There isn't a way to dynamically create reports at runtime so if you have a situation where you need 1 to n charts on your report the solution is to create n reports at design time and then at runtime suppress the ones that you don't need.  

Another possibility is that you simply create multiple different reports - each formatted the way you need it - and then have your application determine which report should be loaded based on the chart(s) that you need to see.  This is probably going to be more efficient than generating a lot of charts that end up being suppressed.

If this answer doesn't help you, can you explain a little more your needs - perhaps give 2 real world examples to help us understand what you're trying to accomplish?


Author Comment

ID: 20085309
Here you are with my exact requirement of the application.

The "Profitability Comparison" of 2 companies is to be shown in Line chart, whereas the "Cost Break-Up" is to be shown in Pie chart, and the "ROE & ROA comparison" is to be shown in Bar chart.

Similar to this, there can be 'N' number of charts which is not defined in the design time (neither the type of charts nor the number of charts nor the order of placement too).

At the querypad page of this report generation only, the user will specify the details of these charts - type, number and order.

Hence, i could not design the all possible scenarios of charts in reports and suppress them at runtime. But hope this should be possible if we create the report itself dynamically at runtime. Please let me know how we can create the RPT file dynamically at runtime using Report Designer / CrystalReportViewer, etc.?
LVL 101

Expert Comment

ID: 20085408
Crystal doesn't lend itself well to allowing the user to specify the requirements at that point.  

What version of Crystal do you have?  If it is the version that comes with Visual Studio you may not be able to do it.  This will require runtime licenses for Crystal for all users and may even require all users to have Crystal installed.

LVL 42

Accepted Solution

frodoman earned 2000 total points
ID: 20087187
Hi Yogeshup,

I understand your requirements, but as I've said you aren't going to be able to do that with Crystal.  You may want to consider using MS Reporting Services instead - you can build a completely dynamic report within your .Net app using MSRS.


Expert Comment

ID: 20295404
Forced accept.

EE Admin

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question