Page 1 of 1

Combine two datasoure/datatable into one datatable

Posted: Wed Jun 20, 2018 2:01 pm
by zalak
Hello,

I am new to Stimulsoft and I need to create simple bar graph with one extra bar for showing the average value.
(I have attached an image showing what should be the expected output)

About DataSoure:
There is one main DataSource coming from the application from which I want to create a new datasource for the chart. I need to create this new datasource using User Interface and NOT by coding.

GraphTable: The simplest DataTable I could create from main DataSource is something like this
Year Quantity
2014 1
2015 1
2016 2
2017 1
2018 2

In order to show the average bar I need to add one more row to this DataTable (GraphTable) with values as Year => Average & Quantity => 1.2.
Is there a way I can add one more row to this table?

Or

I created another DataTable "AvgTable"
Year Quantity
Average 1.2

Now, Is there a way I can combine the above two tables into one datatable?

Thanks & Regards,
Zalak

Re: Combine two datasoure/datatable into one datatable

Posted: Fri Jun 22, 2018 3:56 pm
by HighAley
Hello.

You can add additional series and show such bar.
You could add a Constant Line.
Please, look at the attached report.
We use a variable and some code in events.

Thank you.

Re: Combine two datasoure/datatable into one datatable

Posted: Mon Jun 25, 2018 3:29 pm
by zalak
Hello,

Thank you for your reply. What do you mean by "code in events"? can you give me example and where to write it? Is it like writing an expression?

Also, if I add additional series for showing Average it does not show as a separate bar but either stacked on series 1(Stacked column) or adjacent to series 1(Clustered column).

Thanks & Regards,
Zalak Dobaria

Re: Combine two datasoure/datatable into one datatable

Posted: Mon Jun 25, 2018 4:25 pm
by HighAley
Hello.

There is a code on the Before Print event of the DataBand and Footerband.
To see it you should select it and open events list.
Events (2).png
Events (2).png (10.68 KiB) Viewed 2392 times
Thank you.

Re: Combine two datasoure/datatable into one datatable

Posted: Tue Jun 26, 2018 12:50 pm
by zalak
Hello,

Thank you so much for the details, I had no idea about Events in report designer :o .
Will work around with this and see if I can get required results.

Thank you once again.

Regards,
Zalak Dobaria

Re: Combine two datasoure/datatable into one datatable

Posted: Tue Jun 26, 2018 4:10 pm
by HighAley
Hello, Zalak.

We are always glad to help you.
Let us know if you need additional help.

Thank you.