Dynamically adding a subreport to a page

Stimulsoft Reports.NET discussion
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamically adding a subreport to a page

Post by HighAley »

Hello.

Please, try to use next code:

Code: Select all

            this.HorizontalLinePrimitive1 = new Stimulsoft.Report.Components.StiHorizontalLinePrimitive();
            this.HorizontalLinePrimitive1.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(3.8, 0.4, 7.8, 0.0254);
            this.HorizontalLinePrimitive1.Color = System.Drawing.Color.Black;
            this.HorizontalLinePrimitive1.Name = "HorizontalLinePrimitive1";
            this.HorizontalLinePrimitive1.EndCap = new Stimulsoft.Base.Drawing.StiCap(10, Stimulsoft.Base.Drawing.StiCapStyle.None, 10, true, System.Drawing.Color.Black);
            this.HorizontalLinePrimitive1.StartCap = new Stimulsoft.Base.Drawing.StiCap(10, Stimulsoft.Base.Drawing.StiCapStyle.None, 10, true, System.Drawing.Color.Black);
Thank you.
prajan
Posts: 49
Joined: Tue Apr 23, 2013 1:28 pm

Re: Dynamically adding a subreport to a page

Post by prajan »

Hi,
I tried using the following code :

Code: Select all

 StiVerticalLinePrimitive VerticalLinePrimitive6 = new Stimulsoft.Report.Components.StiVerticalLinePrimitive();
        VerticalLinePrimitive6 = new Stimulsoft.Report.Components.StiVerticalLinePrimitive();
        VerticalLinePrimitive6.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 3.6, 0.01, 2.3);
        VerticalLinePrimitive6.Color = System.Drawing.Color.Black;
        VerticalLinePrimitive6.Guid = null; 
        VerticalLinePrimitive6.Name = "VerticalLinePrimitive6";
        VerticalLinePrimitive6.EndCap = new Stimulsoft.Base.Drawing.StiCap(10, Stimulsoft.Base.Drawing.StiCapStyle.None, 10, true, System.Drawing.Color.Black);
        VerticalLinePrimitive6.Interaction = null;
        VerticalLinePrimitive6.StartCap = new Stimulsoft.Base.Drawing.StiCap(10, Stimulsoft.Base.Drawing.StiCapStyle.None, 10, true, System.Drawing.Color.Black);
        MainRepPage.Components.Add(VerticalLinePrimitive6);
        VerticalLinePrimitive6.Page = MainRepPage;
I am getting the output as shown in "Wrong.jpeg".
I want to get the output as shown in "Right.jpeg". What do I need to do to achieve the same?

Thanks
Attachments
Right
Right
Right.JPG (150.24 KiB) Viewed 1986 times
Wrong
Wrong
Wrong.JPG (149.49 KiB) Viewed 1986 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamically adding a subreport to a page

Post by HighAley »

Hello.

Please, send us a working sample project for analysis.

Thank you.
prajan
Posts: 49
Joined: Tue Apr 23, 2013 1:28 pm

Re: Dynamically adding a subreport to a page

Post by prajan »

Hi,
PFA the page and the data for the same.

Thanks.
Attachments
Data for Rep.xlsx
Data for the report
(12.1 KiB) Downloaded 146 times
Default2.aspx.cs
Report page
(58.93 KiB) Downloaded 148 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamically adding a subreport to a page

Post by HighAley »

Hello.

Sorry, but we couldn't reproduce your issue.
We need to see a FULL WORKING SAMPLE PROJECT, not one cs-file.

Thank you.
prajan
Posts: 49
Joined: Tue Apr 23, 2013 1:28 pm

Re: Dynamically adding a subreport to a page

Post by prajan »

Hi,
PFA the web application for the report and the data for the same in xml format.
Please let me know if you need any other information

Thanks.
Attachments
Data for rep.rar
Data for report
(5.05 KiB) Downloaded 154 times
BSReport.rar
Report web application
(185.44 KiB) Downloaded 165 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamically adding a subreport to a page

Post by HighAley »

Hello.

Please, try to Save report template at the end of the CreateReport2 method. If you open this report template in the designer you will see that your report is not right.
Please, chenge your code to get right report template then it will be possible to create it without primitives.
At first remove DataBands without Data Sources and Panels from sub-reports.

Thank you.
prajan
Posts: 49
Joined: Tue Apr 23, 2013 1:28 pm

Re: Dynamically adding a subreport to a page

Post by prajan »

Hi,
The report is now showing correctly.
PFA the report web application.

Please let me know if you need anything else.
We need to use primitives only as we cannot use borders 'cos some of the bands are not displayed based on certain conditions.
Please help us achieve the same.

Thanks.
Attachments
BSReport.rar
Report app
(183.6 KiB) Downloaded 149 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamically adding a subreport to a page

Post by HighAley »

Hello.

Prajan, please, read next message carefully.

I understand that you sent me simple report template at first time and there are not all columns.
And knowing it I am repeating my previous message:
Aleksey Andreyanov wrote:Please, try to Save report template at the end of the CreateReport2 method. If you will open this report template in the designer you will see that your report is not right.
Please, chenge your code to get right report template then it will be possible to create it without primitives.
At first remove DataBands without Data Sources and Panels from sub-reports.
The StiVerticalLinePrimitive is connected to the components with 2 Cap points.
They are VerticalLinePrimitive6.EndCap and VerticalLinePrimitive6.StartCap. If they are on the component, then they move with it. But if it's on the page then it's static. You are adding static Line in your code.
Line.png
Line.png (2.85 KiB) Viewed 1940 times
To help you understand I am sending you your report template.
Report.mrt
(143.97 KiB) Downloaded 280 times
Why do you add Panel10, Panel14, Panel 20, Panel23, Panel26, Panel33, DataBand11, DataBand15, DataBand24 and DataBand28?
You don't need all of them.

Thank you.
prajan
Posts: 49
Joined: Tue Apr 23, 2013 1:28 pm

Re: Dynamically adding a subreport to a page

Post by prajan »

Hi,
I have a doubt.
Please find attached the static report 'BS_Horz_NoPC.mrt.
In this report also we have so many databands without data source (Databand5, Databand2, Databand8, Databand1, Databand7, Databand9).
Also attached is the page which is used to run the report.In this report also I have added vertical line primitives to Page1. These are coming just fine in the report.
But when I try to generate this report dynamically, and I add vertical line primitives to the main page, then I don't get the report right.
Please let me know how I can dynamically generate the same report with vertical line primitives.

Thanks
Attachments
BS_Horz_NoPC.mrt
(134.68 KiB) Downloaded 151 times
BalanceSheetReport1.aspx.cs
(3.24 KiB) Downloaded 147 times
Post Reply