ReportViewer excel export set sheet names - webforms

I'm using the WebForms variant of the ReportViewer.
Let's say my report have records separated by two logical parts - CommonData and PersonData (they all have common field, say personId).
I've created the report to display one record on two pages - one with CommonData and one with PersonData.
When I click the export to Excel, the excel files contains one Sheet for eage page from the report. This result, in have one sheet for CommonData and the next sheet is for PersonData. The default labeling of the sheets is "ReporPerson1", "ReportPerson2". I want to change this naming with the following convention - "<> Common data" and the next one to be "<> Person data"
How can I do that? I found solutions setting the PageName property of the report, but this will set all sheets with this name!

I have found the solution in this thread
http://blogs.msdn.com/b/robertbruckner/archive/2010/05/16/report-design-naming-excel-worksheets.aspx

Related

SSRS 2008 - Document Map Label when exported to Excel works differently than when in SSRS

SSRS 2008, document map label navigates as expected in SSRS; however, when exported to Excel it does not.
Example: The tablix has a row grouping and via the properties has a page break per that (i.e., on Client Group, see Snippet link below). When I run the report and click the document map label name it takes me to the first item in the Client Group (as expected). When exported to Excel, it takes me to the last item in the Client Group... which I don’t want.
Snippet of Advanced Group Properties

VBA for splitting the existing sheet using the values in drop down

I have created a file which is having a drop down list of names vlookup on Sheet1 with another sheet. Hence, one name is selected the values will be displayed on the Sheet1 as vlookup arranged.
I need a VBA for that dropdown list having cell (B4), Hence it should be split into multiple worksheets with the specific names.
Can anyone help?
Shane -

Adding tables at run time in Telerik Reporting

I've been reading Telerik's documentation and I'm not sure if this is possible: I'm being asked to add tables to a report at run time, without doing so programmatically. A query is run that fetches hierarchical data, and the report owner would like to add a new table to the report for each member of the topmost parent, so that each topmost parent has their own table, with a text box title on top of the table containing the parent's name, in the following pattern:
TopParent1
[Parent1's table]
TopParent2
[Parent2's table]
...
Does anyone know how I could go about doing that without doing so programmatically? Every example and/or bit of documentation I've seen pertains to programmatically adding tables.
It is possible to add tables to a report at run time, without doing
so programmatically?
R: It's not possible to add table with out saying programmatically : the size of each element , the exact position , etc .. .. ..
HowTo create a 'hierachical' report with conditional display ?
1/. Hierachical Report.
Read the telerik official tutorial on How to: Create a Master-Detail Report Using a SubReport Item
Using the SubReport report item you can display one report within another report. The data for each SubReport can be completely different.
But You can achiev Parent/chield relation by Passing Parameters to a SubReport.
/!\ Caution /!\
Page sections are not related to the report itself, but are relative to the paper or screen. Thus page sections of nested/detail reports are ignored and only the page sections of the main report are visible.
In order to have sections that repeat on every page similar to page sections, consider using an unbound group (no grouping criteria specified) and set the PrintOnEveryPage property of its sections to True. Be aware that you cannot use PageCount and PageNumber global objects in group sections.
2/. Conditional Display
You will need to hide Report if subreport have no result.
If you want the user to choose if he want some sub report.
You can do it by passing parameter from your calling application to your report constructor.
And use Something like a Bitfield or an enum to choose what to display.
And What about a C# controler in the master report code behind ?
public myReportConstructor(int SubreportToDisplay)
{
InitializeComponent();
Hiden_Display(SubreportToDisplay);
}
private void Hiden_Display(int _code)
{
if ((_code & (int)myEnum.InfoClient) != (int)myEnum.InfoClient)
HideNShrink(SUBREPORT_CLIENT);
if ((_code & (int)myEnum.Item) != (int)myEnum.Item)
{
HideNShrink(SUBREPORT_Product.Item1);
HideNShrink(SUBREPORT_Product.ItemTWO);
}
}
private void HideNShrink(ReportItem target)
{// http://www.telerik.com/support/kb/reporting/details/collapse-the-container-when-hiding-child-report-items-
target.Visible = false;
target.Height = Telerik.Reporting.Drawing.Unit.Pixel(1);
}
I use a little trick here in my designer every subreport item is set to public:
private Telerik.Reporting.TextBox textBox17;
public Telerik.Reporting.SubReport SubReport_Client;
public Sub_Client sub_CLI1;
When hidding Client I will use the SubReport_Client.
That is the SubReport item, the container of my SubReport Sub_Client ;
(Yes they name the container and the containt are the same name, thats confusing at First, but it's Vs/Telerik choice)
When hidding a Sub Report That is in an other Sub Report.
I use the ContaintSubReport, Container of the nested-nested SubReport.
like: sub_CLI1.nested-nested_SubReport
I was able to answer my own question as follows:
Create two blank reports.
On the report chosen to use for the detail report, remove the report header and footer.
Add data source and parameter/s to the detail report (in my case, an SQL data source) and set report data source to the data source created here.
Add group to report with the value of groupings set to the top-most result in query bound to report. (Groupings = Fields.Parent)
Create text box with the value set to the field for the top result (textbox1.Value = Fields.Parent) or use data explorer to drag and drop Fields.Parent into the group header.
Create text boxes to mimic table column heads (one text box for each title of the columns) and place them into the group header with the text box containing the topmost result (or Fields.Parent).
Drag or create text fields for the rest of the fields in the query (Fields.Child1, Fields.Child2, Fields.Child3, etc) in the detail section of the report, aligned vertically with their column header. Preview the report--it should contain a table-like structure that repeats on each top result.
Switch to other report.
Add same parameter/s to that report.
Add subreport item to the detail section of that report.
Set subreport report source to Type and report document, then select the name of the detail report (the first one created here).
Set parameter/s for subreport to the same parameter/s used in the subreport.
Using that, I was able to essentially add a table per item in the first column of the query. The report created first serves as a wrapper for the query, and because it's being placed in the other report as a subreport item with the grouping I created, it is allowed to repeat as much as it needs to in order to display all the rows in the query.
I used the Telerik documentation for master-detail reports and report structures for this.

SSRS Page footer does not display the correct information after the first page

I am working on a SSRS report for SQL 2005 in Visual Studio 2005 and I need to include information in the page footers from a dataset. I followed the information in the following Microsoft article http://technet.microsoft.com/en-us/library/ms159677(v=sql.90).aspx
I setup several hidden textboxes in the body of the report to hold the aggregated dataset information I need. I then reference those textboxes in the page footer of my report.
The page footer on the first page is correct but on the rest of the report pages the text boxes are not getting the information. In my situation, I am getting the user id and date from a dataset and trying to display it on each report page in the footer.
More details:
In the first hidden textbox (lblDatetime) in the body I get the value from the dataset like the following:
=First(Fields!Date.Value, "headerData1")
In the second hidden textbox (lblUserID) in the body I get the value from the dataset like the following:
=First(Fields!UserID.Value, "headerData1")
I then reference the first textbox in the footer using the following:
=First(ReportItems!lblUserID.Value)
I then reference the second textbox in the footer using the following:
=FormatDateTime(First(ReportItems!lblDateTime.Value),DateFormat.ShortDate)
=FormatDateTime(First(ReportItems!lblDateTime.Value),DateFormat.LongTime)
I tried aggregating the dataset directly in the footer but this is not possible and causes errors.
I came up with a different solution to the one suggested in the article.
Instead of adding hidden textboxes to my body, I created two global hidden parameters. I set the default value using the "From Query" for those parameters to the datasets I needed. I then referenced those two new global parameters instead of the textboxes.
This fixed my issue.

Merge multiple Birt reports into one

I have seen all the samples of the Birt reports available in eclipse - they do not say how to have multi paged Birt reports - as in what if I have ten tables - and all of them producing different data - These cannot be put in one page.
So how do I add multiple pages to one report?. Or if that is not possible - how do I club multiple reports (Each report containing one page design only :( ) together - without any page breaks
Can we do this without any programming? If not, can someone point to example source code - where merger is demonstrated ?.
I don't know of any tool to combine separate reports automatically.
The simplest way to combine multiple reports into a single report is to copy and paste the report items from the layout tab (Tables, Charts, Cross Tabs etc) of each of the original reports into the layout tab of the combined report.
You can force page breaks between different report items on the Page Break section of the Properties tab within the Property Editor for the relevant report items.
You will need to ensure that the combined report has all required data sources, data sets and report parameters - these can be transferred from the original reports by copying and pasting from the Data Explorer within the original reports, into the Data Explorer in the combined report.

Resources