Automatically change pageHeaderSection content of all reports

1 Answer 136 Views
General Discussions
Coopbase
Top achievements
Rank 2
Iron
Iron
Coopbase asked on 07 Oct 2022, 08:10 AM

Hi, In the pageHeaderSection, I have written there the company name, their address and the logo coz I want to appear it on every page and this is for the 1st cooperative report. We are handling a lot of coops, so if I'm going to upload the report to each of our client server,  I would like to know how to change the pageHeaderSection content where if I change the content, all reports page header should be affected, In short I wouldn't be manually opening all reports just to change the content of the pageHeaderSection. 

Scenario: If the 1st coop opens the report, they will see just their company name, their address and the logo, its like it will automatically change the pageheadersection content depends on what client access the report. Any idea on how to do this?

Dimitar
Telerik team
commented on 11 Oct 2022, 01:28 PM

Thank you for the provided information!

Generally, there are many ways to do this but preferably, the data for the company name, the logo, etc. should come from the data source that is used by the report. Then, the page header should simply display the fields that return the company name, the address, and such. 

Currently, do you have this data hardcoded in the page header section? If yes, is it possible to add this data to whatever data source components the reports use?

When you have set up the report so that this information comes from the report's data source, then it would be as simple as changing the query if SqlDataSource is used, or the URL for example if WebServiceDataSource is used, and so on.

Each report has a global object named UserIdentity which naturally represents the current user identity. You could use this to filter your data for the given user and that should be the key to implementing this dynamic page header section.

Coopbase
Top achievements
Rank 2
Iron
Iron
commented on 12 Oct 2022, 06:51 AM

Thanks for the response Dimitar,

Currently, I hardcoded the data in the page header section coz these data are not available in the data source but if you suggest that the best approach is to get it from the data source, I still need to ask our DBA regarding on this. 

Just incase if we can't add these data in our database, are there any work around or another approach?

I will read more on this UserIdentity, haven't tried it since I'm more focus on creating the reports previously.
Coopbase
Top achievements
Rank 2
Iron
Iron
commented on 12 Oct 2022, 07:38 AM

How do you retrieve the data from the datasource in the pageheader? should I retrieve it using the table? seems like its not possible.
Dimitar
Telerik team
commented on 14 Oct 2022, 11:42 AM

Data items such as the table cannot be used in the page sections.

In order to display information from a data source in those sections, you would need to set the data source component, where that data is available, to the Report.DataSource property. Then the data will be directly accessible in the page sections and you can simply insert a TextBox whose Value will be one or more of the fields of the Report.DataSource.

Other than the data source approach, you could use report parameters to pass this data dynamically :

 

1 Answer, 1 is accepted

Sort by
0
Coopbase
Top achievements
Rank 2
Iron
Iron
answered on 12 Oct 2022, 06:49 AM

Thanks for the response Dimitar,

Currently, I hardcoded the data in the page header section coz these data are not available in the data source but if you suggest that the best approach is to get it from the data source, I still need to ask our DBA regarding on this. 

Just incase if we can't add these data in our database, are there any work around or another approach?

I will read more on this UserIdentity, haven't tried it since I'm more focus on creating the reports previously.

Tags
General Discussions
Asked by
Coopbase
Top achievements
Rank 2
Iron
Iron
Answers by
Coopbase
Top achievements
Rank 2
Iron
Iron
Share this question
or