Can I customize the report without opening report designer?

Stimulsoft Reports.WEB discussion
Post Reply
jinzhouwan
Posts: 3
Joined: Thu Jul 19, 2012 4:30 am

Can I customize the report without opening report designer?

Post by jinzhouwan »

Report designer is very powerful and may be too much for end user. Can we customize the report without report designer?
Here's an example about our requirement. After loading the report, we need do following things:
1. Pick a cell
2. Set line style, font for selected cell
3. Add a row or column into header band.
4. Add or remove fields from data band at run time

Thank you in advance!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Can I customize the report without opening report design

Post by HighAley »

Hello.
jinzhouwan wrote:Report designer is very powerful and may be too much for end user. Can we customize the report without report designer?
Here's an example about our requirement. After loading the report, we need do following things:
1. Pick a cell
2. Set line style, font for selected cell
3. Add a row or column into header band.
4. Add or remove fields from data band at run time
You could change your report at runtime in your code.
Here is a sample project how to create report there you could find some useful code.
Also you could look at the code page in the Designer to find out how change reports.

If you have some additional questions, please do not hesitate to contact us.

Thank you.
Attachments
DynamicCreateReportWithGroups.zip
Sample project
(17.21 KiB) Downloaded 182 times
jinzhouwan
Posts: 3
Joined: Thu Jul 19, 2012 4:30 am

Re: Can I customize the report without opening report design

Post by jinzhouwan »

Thank you for your quick response! And I have another question.
How can I capture the event about clicking a cell? Can I catpture the event in webviewer?
I added following lines before report.Complie

Code: Select all

            
            StiComponentsCollection components = report.GetComponents();
            foreach (StiComponent component in components)
            {
               component.Click += new System.EventHandler(Cell_Click);
            }
            
            report.Compile();
            report.Show();
and I added a event named Cell_Click

Code: Select all

       private void Cell_Click(object sender, EventArgs e)
       {
          StiComponent component = sender as StiComponent;
          if (component != null)
             MessageBox.Show(component.Name);
       }
But I still cannot capture the event about clicking a cell.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Can I customize the report without opening report design

Post by HighAley »

Hello.

There is no events in StiWebViewer.

Thank you.
jinzhouwan
Posts: 3
Joined: Thu Jul 19, 2012 4:30 am

Re: Can I customize the report without opening report design

Post by jinzhouwan »

I tried these codes in the sample you attached,but doesnt work. WHat,s wrong?
It's said that StiWebViewerFx support event, I think I can support event in simlar way as winform application, right?

Thank you!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Can I customize the report without opening report design

Post by HighAley »

Hello.
jinzhouwan wrote:I tried these codes in the sample you attached,but doesnt work. WHat,s wrong?
Please send us your project. What errors or exceptions do you have?
jinzhouwan wrote:It's said that StiWebViewerFx support event, I think I can support event in simlar way as winform application, right?
The events isn't supported by StiWebViewer and StiWebViewerFx. It's impossible to do in browsers.
Th events is supported in .Net and Wpf products only.

Thank you.
Post Reply