How To Change Report Headers And Footers Dynamically From ASP.NET
Jan 21, 2008
Hello All,
I have designed some reports and kept these reports in the report server.
My question is: I want to change report header and footer values dynamically and save the new values in the report template, when the user enters new velues in ASP.NET GUI.
Next time if the user opens the same file the report should display the recent values.
Please help me in passing the parameters from ASP.NET app to SQL Reports and saving the parameters in the report template.
I have an image stored in a dataset that I would like to place in the page header and footer. Unfortunately dataset fields can not be placed in headers/footers.
Embedded pics in the project and/or report are NOT an option as the report must pull the image from the database. UNLESS there is a way to embed it FROM the dataset.
Normally I use =ReportItems!FieldName, but this doesn't seem to work when dealing with images.
I put the image in the header row the table holding the report information, but there are some pitfalls. Consider the following: put the Image in the top left cell of the header rows (A1) , put my Report Title in Cell (A2) and finally put =Now() in cell (B2).
When the report renders Cell (A1) has grown to accomodate the size of the image, Cell (A2) is fine, but cell (A3 - the date-) is pushed down...as expected (boooo!)
I used the following function =Fields!ReportTitle.Value & chr(10) & chr(13) & Fields!ReportDate.Value in (A2) a slick solution, but the padding is different and I need different font sizes and weights. (...almost)
I moved the image in (a1) and the rest of the fields following respecfully (B1, C1, D1...) but with parameters the header is now practically half the page (...ok so that was a bit of an stretch)
I tried the RepeatsWith property and couldn't get it to work???? Am I using it correctly? I have a table in the body of a report (table1). Above it, I place the image. In the image properties, I choose RepeatWith and select table1, I expect to see the image repeat on each page, but that is not the case. I'm probably missing a simple explanation.
I even tried to pass the image as a parameter. URRRNT! At least with my experience.
Have I exhausted all possibilities without extensive code?
All I'm trying to do is line up the Image with the report Title/date/parameter values in the HEADER making the report look pretty.
Hi All. I am building an SSIS job that will export some data to a csv then ftp it to a remote site. I have been able to create the csv alright, but I need to add header and footer lines to the csv.
The header must be:
Filename+ crlf (will not change) File type+ crlf (will not change)
Create date+ crlf (obviously changes) -- format is mmddyyyy as text
And the footer is:
Filename+ crlf (will not change) File type+ crlf (will not change)
Create date+ crlf (obviously changes) -- format is mmddyyyy as text
Total rows+ crlf (obviously changes)
So I need to first open the file, count the number of rows, then add the header and footer lines.
I would like to do this as a step in ssis, as a function (not by calling a compiled assembly or anything like that). I have no experience with vb.net, and haven't been able to find any snippets on the web that seem to work. Can anybody lend a hand? thx. David
I am creating a report in SSRS and the data is obtained through a stored procedure. One of the parameters is Begin_Date. This is simply a date field. I need to have it on the Page Header section. However, when I placed it there and ran the report, I received the following error -
Error2[rsFieldInPageSectionExpression] The Value expression for the textbox ‘begindate’ refers to a field. Fields cannot be used in page headers or footers.
Is there a way around? I have never faced such a problem when I created reports in Crystal or ActiveReports. Please let me know whether I am missing anything.
I have a report that has three levels of grouping including headers (containing titles) and footers (containing summary values). I would like to programatically show/hide these header/footer sections based on a Show/Hide paramter. Is that possible? Currently I work around the problem by just having two physical reports (one with the header/footers, one without)
Hi, this is probably a simple question but I just can't figure it out. I'm using SQL Server Reporting Services 2005 sp1.
I'm trying to design a report that displays a particular embedded image on the first page, and then a different one on every subsequent page. I.e full, fancy company logo on the first page, and a trimmed down version on every other. In Crystal, I would have simply used the Report Header and Page Header sections to achieve this - easy.
However, in SQL Reporting Services, there is only a Page Header section - therefore whatever I place in the Page Header shows on every page. Now, I know how to stop it displaying on the first page, but I don't know how to display the other image instead.
I read in a support forum that it is possible to do this by "placing report items above or below your data regions" but I can't get it to work.
I've created a horizontal report using a matrix according to the quite useful article Horizontal Tables, but there's one thing I'm trying to do that I'm not having any luck figuring out how to do, and that is creating a footer column for a column group that contains a sum of the values in some of its columns.
In other words, here's how I would like to have it look...
Jan Feb Mar Quarter 1 Total Apr May Jun Quarter 2 Total
Tier 1 $100 $100 $100 $300 $0 $0 $100 $100
Tier 2 $50 $50 $0 $100 $100 $100 $100 $300
The fields in the dataset are Month, Tier1, Tier2, Year and Quarter. I've created a group on Year & Quarter, tried right clicking and selecting Subtotal, but that seems to add a subtotal column after every month, not at the end of the quarter group as I want.
Any ideas on what I need to do? Is this even possible?
I have developed a report in ssrs 2005. While exporting the report to excel 2007, i have a problem in displaying the footer values in spreadsheet. Moreover, in the page footer of the report, i have added a few condtions so as to display one of the textbox's values in the last page alone and the rest in all of the pages! But when i look in to the page layout in excel, i get in all of the pages rather than having it in the last page.
Added to that a cell doesnt hold more than 255 characters in excel.
I wanted to show header titles for each group of accounts. Ho would I be able to do that. The query that I have right now is:
select * from apcopah where substring(ap_control_acct, 1, 4) = '1624' and date_vendor_inv >= '2001-08-01' or substring(ap_control_acct, 1, 4) = '1631' and date_vendor_inv >= '2001-08-01' or substring(ap_control_acct, 1, 4) = '1632' and date_vendor_inv >= '2001-08-01'
I'm new to Reporting Services, but am familiar with other reporting tools. My question is, is there really no way to reference a field in a page header? If so, I suppose you could repeat some header information on subsequent pages from the detail section of the report using a text box, but how is that done because when I check the property box "Repeat report item with data region on every page" nothing happens. What is the best way to repeat header information on every page that needs to contain field values/information?
I have set the option 'Headers should remain Visible while scrolling', in order to freeze the headers. However, on some reports, when I scroll down the report , the headers overlap each other .
I am trying to filter some results using the FilterExpression Property of the SqlDataSource. I have multiple drop down lists with different filtering options. I am trying to change the filter that is applied to a gridview. Something like this example... http://blogs.vbcity.com/mcintyre/archive/2006/08/17.aspx Here is some of my code..Private Sub ApplyFilter() Dim _filterExpression As String = "" If (Not DropDownList1.SelectedIndex = 0) And (DropDownList2.SelectedIndex = 0) And (DropDownList3.SelectedIndex = 0) Then _filterExpression = "CategoryName = '{0}'" End If Me.SqlDataSource1.FilterExpression = _filterExpression End Sub Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged ApplyFilter() End Sub But this doesn't seem to work. The FilterExpression doesn't keep the value. I am looking for a way to dynamically change the FilterExpression. Any Ideas or Suggestions?? Thanks.
We have some reports that have optional columns. We have them working very nicely, with the column showing or hiding based on values in the report -- works great.
Except -- when the columns are present, the report spans onto two pages, when exported to PDF, in width. That's understandable, as there's a lot of extra data, and exactly what we want. However, when the columns are not present, we get empty pages instead, because the report doesn't automatically contract back onto the size that fits on one page.
Changing the report to a Matrix won't work, as the hidden columns on some of these come as sets of three, where each column in the three has different formatting (different widths, format codes, etc).
I've created 1 solution and added all my packages in different projects (like DIMENSIONS, SOURCES_SAP, ...).
For each project I have a Data Source that connects to the server. The problem is that when I want to deploy a package to the server that I always need to change the Data Source before deployment.
Before SQL Server 2005 we used a connection file (which was located as well on the server as on the development pc's in the same locations) within our DTS packages. This way we didn't had to change the connections when deploying to the server.
My intention was to use the current configuration from the configuration manager(development / production) to select the servername. Unfortunately, I didn't succeed to retrieve it's value from a variable script.
I need to have a solution that dynamically changes the datasources for multiple packages depending on a specific action.
Hi All, I have a series of tables need to import to server. When creating the target tables, I want to change the columns name as well, for example: Source table column Target table column
Name FN_Name Age FN_Age
The problem is I suppose I don't know the columns name in source table, I want to the tasks scan the source table and make the change programmlly.
Which tasks or approaches can be used to implement this?
Hi. I have this kind of problem since I am not very conversant with SSIS and stripting in VB.NET.
The set-up is the following: Flat File Source -> Script Component -> Flat File Destination
The flat file source looks like this:
NameOfFile Headers Data Data Data and many more rows of Data NameOfAnotherFile Headers Data Data Data and many more rows NameOfAnotherFile Headers Data Data and so on in the same manner...
My stript looks like that (not very complicated): Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer) Dim strRow As String = Row.Column0.Trim() Dim strFolder As String = "Data" Dim strConn As String Dim charSep() As Char = {CChar(" ")}
If Mid(strRow.ToLower(), 1, 2) = "d0" Then
' This is the file name, so start a new connection to a new file ' which definitely does not exist yet strConn = strFolder + strRow + ".csv"
' DestinationFile is the name of the ' Flat File Connection Manager With Me.Connections.DestinationFile .ConnectionString = strConn End With
Else Row.Column0 = String.Join(",", strRow.Split(charSep, StringSplitOptions.RemoveEmptyEntries)) End If End Sub
I have several questions regarding this one.
1. Is it ok to change the ConnectionString property of the manager to redirect the row to a different file? If not, what more to do?
2. If the new destination file does not yet exist, will it be created for me or will I get an error? If I do, what to do not to?
3. The most important: What steps to take so that a row is discarded from the pipeline in the script? I want some rows not to be directed to the file destination. These are the lines that contain the name of the file into which the data below belongs.
If you can optimize some steps in the script, then please do so by all means. Thank you for any comments and the knowledge you kindly agree to share with me. Darek
I have a report which runs for last 12 months data. Since this is going to be last 12 months the column headers change every month. How can we implement this with dynamic column headers in the dataset?
I want to have two lines of column headers.( with 7 columns in parent columns header)
and 7 columns in child column header.
The first column header will show a parent record.
And after the parent record i want to show the next child related horizontal column headers and will show all child record related to the above parent record.
its a one to many: 1 parent record and below all child records for that parent record.
can i use subreports controls to show all child records of the parent.
I'm sure I'm missing something. I am returning the TOP X number of customers by revenue and I'd like to change the number of records returned by passing a parameter but I keep getting an error. @TopX int ( or varchar) SELECT @TopX CompanyName, Amount FROM Sales Where..... Why will this not work?
Hello I have a gridview that I use on a products page, my problems is certain products have different attributes that I would like to display. Therefore what I would like to do is change the SelectCommand property to my SQLDatasource depending on the querystring that is passed. For instance in my page load event I would have a CASE statement with numerous SQLString Variables. Here is the current coding for my datasource <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT PS.ProductSizeMM AS [Coupling Size], PS.ProductWallThickness AS [To Suit], PS.Cost AS [Price], PS.Sold_By AS [Sold by] FROM tblProduct AS P INNER JOIN tblProductSize AS PS ON P.ProductCode = PS.ProductCode WHERE (P.ProductDescription = @ProductDescription) ORDER BY PS.Sorter"> <SelectParameters> <asp:QueryStringParameter Name="ProductDescription" QueryStringField="ProductDescription" /> </SelectParameters> </asp:SqlDataSource>I have tried declaring a string variable in my page load event (SQLString) then setting the SelectCommand="SQLString" but this causes a syntax error Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'SQLString'. Any help would be greatly appreicated!!
I'm novice to SSIS and looking for some help on SSIS dtexec (SQL Server 2005).
Is it possible to change the BulkInsertTableName when running a package via dtexec /SET?
My test scenario contains:
- SQLServer 2005 SP2, servername: SDPM01, instancename: GWLINST1, databasename 1: TEST, databasename 2: DEV, tablename 1: Test_Table1 (both in TEST and DEV database), tablename 2: Test_Table2 (both in TEST and DEV database)
- 1 Data Flow task in BIDS (SSIS)
- 1 Data Flow Source: Flat File Source (Flat File Connection Manager name: FTP File Output + CSV file with a few lines of data that needs to be inserted in a SQL Server table)
- 1 Data Flow Destination: SQL Server Destination (OLE DB Connection Manager name: SDPM01GWLINST1.TEST
I can dynamically change the name of the database via:
I am looking to dynamically change the connection string in my SSIS package, to avoid changing the connection string each time I want to run in different environments.