Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Monday, March 26, 2012

Report Definition Language

Using VS 2005, I have created a piece of software that creates an RDL file using XML. However, although my data (though a DataView control) is showing as it should, and I can update this to create new data, I cannot get the RDL to display a variable which I change and use as a 'header text' to the report. The variable is shown the first time I display the RDL through a ReportViewer Control but remains static thereafter. The interesting thing is that when I view the XML through a third-party viewer, it shows the correct value stored in the variable.

For information, I am using a child form in a MDI to create the data that is fed into another child form that contains the ReportViewer. The MDI has been programmed so that the child forms are not closed and disposed of, but are hidden from view.

Has anyone any initial ideas of what I could do to flush or clear the RDL or any other relevant object?

Are you viewing the RDL in the report designer when this happens? Report Designer has a functionality to cache the data in preview (http://msdn2.microsoft.com/en-us/library/ms157366.aspx). You should be able to click on the refresh button to get new data.

Report Definition

Is it possible to control the number of table rows that can be displayed by modifying the report definition?Not sure if this is what you mean, but you can control the # of rows displayed by limiting the # of rows fetched from the data source. There's no way AFAIK to fetch N rows but only display N-M rows.|||

>> There's no way AFAIK to fetch N rows but only display N-M rows.

Yes, actually there is <s>.

You do need to give yourself appropriate information from the data source, but this doesn't necessarily mean limiting the rows! (because you might have another data region that shows a different count, in the same report, from the same data).

Here's a reporting query from my favorite ASP.NET add-on table (ELMAH error handler):

Code Snippet

SELECT ErrorId, Application, Host, Type, Source, Message,
[User], StatusCode, TimeUtc,

Sequence, AllXml

FROM ELMAH_Error ORDER BY ErrorId

... now suppose we add a column, as follows:

Code Snippet

SELECT ErrorId, Application, Host, Type, Source, Message,

[User], StatusCode, TimeUtc,

Sequence, AllXml, Row_Number() OVER (ORDER BY ErrorID) AS ItemID
FROM ELMAH_Error ORDER BY ErrorId

(you can add a counter like this different ways in other data sources)

... Now we can add the following filter to a table (or whatever):

Code Snippet

=Fields!ItemID.Value <= 8 ' or whatever maximum you have in mind,

' for example you can say:

=Fields!ItemID.Value <= =Parameters!MyMax.Value

... and readers please note, if you have trouble when you follow these instructions:

When I built this example I had to CInt() (cast) on both sides of the filter expression (including the literal 8!) to get it to work the first couple of times. It may be because I was building the query interactively for the dataset, and the designer doesn't support this clause so, while it processes the SQL, it is not sure about the data type of the result. IAC it does work.

>L<


|||Thanks for your help.

Friday, March 9, 2012

report builder aggregates

Is there anyway to control which aggregates are displayed in Report Builder? Failing that can I turn them off by table or all together.

Thanks.

You have a couple of different options.

1. Turn them off when autogenerating. There are two checkboxes; one for autogenerating count aggregates and one for date aggregates.

2. Delete the ones you know you don't want. I tend to do this with numeric columns that I know are keys or IDs.

3. By default, the Total aggregate is the displayed value in the model. You can disable this behavior in properties of the column, "DefaultAggregateAttribute". Make in "(none)". I spend alot of time making sure my entities are in alpha order so that they are easier to find. This cleans up the look of the final model.

4. Hide the aggregate. I find this one the most useful. You never know when you may be asked to make it re-appear.

R

|||Thanks!

Quick questions. On which screen are these checkboxes, I haven't seen them. Also where would you hide an aggregate?|||

When you run the Autogenerate wizard, the third screen in has mulitple checkboxes for what you want to generate. If you are like me, you just "Next->" on through them. There are some nice options in there.

The hidden property is available on every item in the model. Show the properties window, select the item(s) you want to hide and change the "Hidden" property from False to True.

R

Wednesday, March 7, 2012

Report being generated never shows second report

I have a VS2005 Windows application that displays a reportviewer (SQL 2005) report in a tab control, then displays a second report in a second tab with reportviewer, and so on. The really strange thing is that I had this application working for about 3 months. I even had up to 30 reports in 30 tabs at one point. BUT, for some reason now all I get is the first report and the second, third, etc. tabs show a reportviewer with "Report being generated" that never displays the report. Even worse, another user is able to run this application and DOES get all the reports displayed. So what could have been updated on my PC that is causing this problem?

Thanks in advance.

The obvious question to ask is what's changed? Have you installed any service packs or updates recently? Maybe it was some new software?|||

I was hoping someone else could tell me what installations might cause this problem, because I can't be 100% sure what updates have been done to my PC. Our Network Services group pushes updates and with MS always forcing updates, it's difficult nowadays to know what's going on on your own PC. Anyway, in January, I installed Red Gate's SQL Prompt 3 and Net Services pushed McAfee OAS. I don't know the exact day Report Viewer stopped working, but I'm pretty sure it was working after these installs. The SQL Server/SSRS 2005 is running on SP1, my client SQL is on SP1. Here's the header info in the most recent SSRS log:

<Header>
<Product>Microsoft SQL Server Reporting Services Version 9.00.2047.00</Product>
<Locale>en-US</Locale>
<TimeZone>Eastern Standard Time</TimeZone>
<Path>C:\Program Files\Microsoft SQL Server\MSSQL.1\Reporting Services\LogFiles\ReportServer__02_22_2007_21_43_20.log</Path>
<SystemName>BNTRA</SystemName>
<OSName>Microsoft Windows NT 5.2.3790 Service Pack 1</OSName>
<OSVersion>5.2.3790.65536</OSVersion>
</Header>

Here are the last few lines in this log, that show me trying to run 2 reports. It looks like it does the same processing for both reports here, but it just can't display the report in the viewer.

w3wp!library!5!02/22/2007-22:08:11:: i INFO: Call to RenderFirst( '/JobReports/EOJreport' )
w3wp!library!1!02/22/2007-22:08:12:: i INFO: Call to RenderFirst( '/JobReports/EOJreport' )
w3wp!webserver!5!02/22/2007-22:08:12:: i INFO: Processed report. Report='/JobReports/EOJreport', Stream=''
w3wp!webserver!1!02/22/2007-22:08:13:: i INFO: Processed report. Report='/JobReports/EOJreport', Stream=''
w3wp!library!5!2/22/2007-22:13:21:: i INFO: Cleaned 0 batch records, 0 policies, 2 sessions, 0 cache entries, 2 snapshots, 12 chunks, 0 running jobs, 0 persisted streams
w3wp!library!a!2/22/2007-22:23:21:: i INFO: Cleaned 0 batch records, 0 policies, 2 sessions, 0 cache entries, 2 snapshots, 12 chunks, 0 running jobs, 0 persisted streams
w3wp!webserver!5!2/22/2007-22:29:04:: i INFO: Reporting Web Server stopped

Need more info? THANKS.

|||

After a lot of searching and matching dlls, it looks like that VS 2005 SP1 is my problem. I've started another thread here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1279959&SiteID=1

Report being generated never shows second report

I have a VS2005 Windows application that displays a reportviewer (SQL 2005) report in a tab control, then displays a second report in a second tab with reportviewer, and so on. The really strange thing is that I had this application working for about 3 months. I even had up to 30 reports in 30 tabs at one point. BUT, for some reason now all I get is the first report and the second, third, etc. tabs show a reportviewer with "Report being generated" that never displays the report. Even worse, another user is able to run this application and DOES get all the reports displayed. So what could have been updated on my PC that is causing this problem?

Thanks in advance.

The obvious question to ask is what's changed? Have you installed any service packs or updates recently? Maybe it was some new software?|||

I was hoping someone else could tell me what installations might cause this problem, because I can't be 100% sure what updates have been done to my PC. Our Network Services group pushes updates and with MS always forcing updates, it's difficult nowadays to know what's going on on your own PC. Anyway, in January, I installed Red Gate's SQL Prompt 3 and Net Services pushed McAfee OAS. I don't know the exact day Report Viewer stopped working, but I'm pretty sure it was working after these installs. The SQL Server/SSRS 2005 is running on SP1, my client SQL is on SP1. Here's the header info in the most recent SSRS log:

<Header>
<Product>Microsoft SQL Server Reporting Services Version 9.00.2047.00</Product>
<Locale>en-US</Locale>
<TimeZone>Eastern Standard Time</TimeZone>
<Path>C:\Program Files\Microsoft SQL Server\MSSQL.1\Reporting Services\LogFiles\ReportServer__02_22_2007_21_43_20.log</Path>
<SystemName>BNTRA</SystemName>
<OSName>Microsoft Windows NT 5.2.3790 Service Pack 1</OSName>
<OSVersion>5.2.3790.65536</OSVersion>
</Header>

Here are the last few lines in this log, that show me trying to run 2 reports. It looks like it does the same processing for both reports here, but it just can't display the report in the viewer.

w3wp!library!5!02/22/2007-22:08:11:: i INFO: Call to RenderFirst( '/JobReports/EOJreport' )
w3wp!library!1!02/22/2007-22:08:12:: i INFO: Call to RenderFirst( '/JobReports/EOJreport' )
w3wp!webserver!5!02/22/2007-22:08:12:: i INFO: Processed report. Report='/JobReports/EOJreport', Stream=''
w3wp!webserver!1!02/22/2007-22:08:13:: i INFO: Processed report. Report='/JobReports/EOJreport', Stream=''
w3wp!library!5!2/22/2007-22:13:21:: i INFO: Cleaned 0 batch records, 0 policies, 2 sessions, 0 cache entries, 2 snapshots, 12 chunks, 0 running jobs, 0 persisted streams
w3wp!library!a!2/22/2007-22:23:21:: i INFO: Cleaned 0 batch records, 0 policies, 2 sessions, 0 cache entries, 2 snapshots, 12 chunks, 0 running jobs, 0 persisted streams
w3wp!webserver!5!2/22/2007-22:29:04:: i INFO: Reporting Web Server stopped

Need more info? THANKS.

|||

After a lot of searching and matching dlls, it looks like that VS 2005 SP1 is my problem. I've started another thread here:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1279959&SiteID=1