.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Determine the Current Report Rendering Format

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :Sql Server

I have several reports in SSRS 2005 (SharePoint Integrated Mode) that have Jump to URL navigation links.  The links were working intermittently, and the fix I implemented was to use a Javascript window.open command for the links, and it worked.  However, now the links do not work when the reports are exported to Excel because it doesn't support Javascript.  I'm trying to satisfy the users' requirements of having the links work regardless of how the report is rendered.  Is there a way that I can use custom code to determine the current URL (with query string parameters) so that I can parse it to determine whether the report is currently being rendered as HTML, Excel, PDF, etc.?  If not through parsing the URL, is there another way to go about this that I'm missing?

Thanks in advance,


View Complete Post

More Related Resource Links

How to determine if current SQL User is admin or owner?

I wish to determine, from my C# application, if the current user has admin or owner rights to the database they are connected to. I beleive I have all the information required: Servername Database name Windows/Database auth username (If database auth) password (if database auth) I'm trying to find a way that using the smo objects (smo.user), but as of yet I cant quite work it out: - How to get the appropriate user - How to determine if that user is an admin/owner. Any tips would be appreciated. If I have posted to the wrong forum, let me know - I couldnt find one that was obviously more appropriate. Thanks.

Rendering a report in TIFF at 300ppi

It's amazing to me that something that should be so simple has already eaten up nearly a day. This URL : //s0550284/ReportServer?/ERecordingReports/Report1&rs:Format=IMAGE&rc:DpiX=300&rc:DpiY=300&rc:PageHeight=11in&rc:PageWidth=8.5in&rs:Command=Render Should cause a report to be rendered as TIFF at 300ppi with a page size of 8.5 x 11. Instead, what I get is a TIFF image file at 96ppi with some rediculously large page size. If I try the same URL without the page size limiters, I get exactly the same results. There seems to be absolutely no way to get the reporting engine to diverge from it's default 96ppi setting. Changing the values in the configuration files has no effect. It's as if the 96ppi value was accidentally hardcoded in the web service interface somewhere and not subject to override. Has anyone had any success trying to change the image density? Your assistance would be greatly appreciated! I'm running SSRS 2008 R2. Regards, -Tom

Automatically print in a landscape format when report does not fit into a portrait format

Good morning,When I print a report, sometimes this report fits into a portrait format, sometimes, it does not, depending of the size of certain field that can grow, do someone know a way to automatically print into a landscape format if it does not fit into a portrait format?, I join the code of this report, when I print it, I have pages thats contain only a few caracters... I do not find how to attach a file here because if I could, I have printed this report in PDF so you will be able to see my problem.Thanks The code seems to be too long to fit in here, I can email to anyone that need to know more  

How to get "Current Date" on SharePoint Designer for Invoice Ageing Data View Report??

Hi Experts, I would like to know how can i get/show "Current Date" in SharePoint Designer ?? Any good tutorial ? FYI, I need this "Current Date" for my Ageing Data View Report, Purpose To offset with "Invoice Receive Date" to get total days of payment payable for the invoice. Please assists, Thanks

Trouble importing strange column format report from Excel 2007 to SQL 08

Hi, I'm not sure whether this belongs in this section or the SSIS one so hopefully I've got it right!  Hoping someone will be able to help with a problem I'm having importing a report with header and detail rows from our antiquated POS system into SQL 2008 tables.  The reports export in Excel 2007 format and for each header row there can be one or more detail rows starting from column B.  As such I've tried several things such as openrowset, an Access 12.0 OLE DB source in SSIS and even COM automation of Excel to try and write a conditional split which will hold the header details in variables then write them to rows alongside the detail rows.  I've pasted a small sample of the data here as I wasn't able to attach it: 01/07/2010 @ 11:18 Page: 1 RECEIVING: Voucher Journal Sort: VC|Str|Vou Date|Vou #|Document SID Filter: Voucher Date: 01/06/2010@12:00a..30/06/2010@11:59p Include Item detail: DCS|Item#|Desc1|Attr|Material|Size|Qty VC Str Vou Date Vou # Qty ABC 001 15/06/2010 12345 38 E NN 66 200148 XXXXXXXX RED SHAD E NN 66 200149 YYYYYYYYY BLACK GO E PP 60 200154 ZZZZZZZZZ BLACK CDE 002 16/06/2010 13839 8 F SA 35 217500 XXXXXXXX Natural F SA FL 218674 YYYYYYYYY Chalk F SA WE 221462 ZZZZZZZZZ White FGH 001 21/06/2010 13905 3 F SH 85 126260 XXXXXXXX Navy IJK 001 23/06/2010 13914 3 E AA 61 250005 YYYYYY

Displaying Image stored in rtf format in access database displaying it on crystal report

Hello, I'm working on a C# project combined with "Crystal Reports 10". When a user inserts something in a "TextField" in my C#-Program, it's saved  as RTF-code (Bolt,Pictures,Underlined,....) to a database.. So if they  reopen it in my "C#"-program they're able to see what they've entered  including their pictures .... But when I created a "Crystal Report"-file and combined it with the same  database used in my "C#"-program, it only show the formatted text and not  the pictures or images... Is there a way to show the "Picture" or "Image" they've inserted in RTF-code  ??? When I copy the code from the database in a simple Text-File and rename  it too "Test.rtf", it wil open correctly in word (with picture and  everything else)... So I hope there is a way to get the picture, Cz it's rather important  they've got a picture of the product they wanna print ...

Rendering reports in crystal report viewer

I am trying to put a crystal report viewer into MVC. When I point a report to the viewer, this is what I get.The report is able to display however there are these box surronding the textfield objects of the crystal report. The attached image is what is being displayed when I view my report on a view.

Report Format RDL Version Control

Hi, I've been using file name with date plus the time stamp as my version control. As my library grow it's getting out of control and there are chances that I mistakenly saved the file over the previous version. What is the best practice and tool for RDL report format version control?

Display current time (live?) on report?

Is it possible on a report to display a clock showing the current time, ticking? Or, is it possible to display a static picture of an analog clock? I have the current time with an expression, but would love to have it updating real time. Any luck with javascript or anything?

SSRS Report rendering issue


Hi All,

i have a chart report and deployed in server and created a subscription for sending email with webarchive type. I can see the chart in out look and it is perfect. when i see the same report in blackberry the fonts are not showing properly(blured).

I have tested via attachement as a pdf file then i can see the clear report in both outlook and blackberry but when make a mode as webarchive i getting the font problem in blackberry.

I am looking for the solution.





- Thiru

Change row values in report before rendering


I have a detail section in report. I am perfectly able to retrieve all the data from the Sharepoint List into datatable and bind it, to generate reports inside the details section.
All the columns and related row data are getting displayed as reports in to the detail section.
But, my issue is, I want to change the row data for a particular column before rendering on to the report.

for instace, if column named Product has some values, I would like to display these values with different string name based on a switch condition. How do I achieve this?

How to change row value of column before rendering on to the report

I have a detail section in report. I am perfectly able to retrieve all the data from the Sharepoint List into datatable and bind it, to generate reports inside the details section.
All the columns and related row data are getting displayed as reports in to the detail section.
But, my issue is, I want to change the row data for a particular column before rendering on to the report.

for instance, if column named Product has some values, I would like to display these values with different string name based on a switch condition. How do I achieve this?

Blank page while exporting the SSRS report to PDF format

While exporting SSRS report to PDF, I am getting blank page in between and at the end also. The report page size is set to 8.75in x 15.00in with 0.02in margin from left, right, bottom and top. I tried in changing the tablix and rectangle box "KeepTogether" property also. In both the case (true/false), I am getting blank pages. Can anyone help me out?

How to determine path to SSRS report


How can I find the path to an ssrs report? I am working on a project that will convert the report to a pdf and print in the background. Below the line is highlighted where I set the reportname.





using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Services;
using System.Net;
using System.IO;

namespace BackgroundPrint
    class Program

        public BackgroundPrint.ReportExecution2005.ReportExecutionService rsExec;

        static void Main(string[] args)

            ReportService.ReportingService rs = new BackgroundPrint.ReportService.ReportingService();

            BackgroundPrint.ReportExecution2005.ReportExecutionService rsExec = new BackgroundPrint.ReportExecution2005.ReportExecutionService();

            rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

            rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;

            rs.Url = "http://narreports/reportserver/reportservice.asmx";
            rsExec.Url = "http://narreports/reportserver/reportexecution2005.asmx";

            string shipmentID = string.Empty;
            string format = "PDF";
            string deviceInfo = null;
            Byte[] results;

Date picker format -> Preview vs Report


I'm at my wits end!

When previewing a report on one of our machines, the date format for a parameter insists that en-GB dates are invalid (dd-mm-yyyy-). Instead, it requires en-US (mm-dd-yyyy). When deploying the report, it goes back to the correct format of en-GB.

Bear in mind, this works on all of the rest of our development machines exactly as required. Only this one machine doesn't work.

I've tried: -

  • Setting the report properties to United Kingdom - it already was
  • Changing ReportViewer.aspx to include --> <%@ Page Language="C#" AutoEventWireup="true" Inherits="Microsoft.ReportingServices.WebServer.ReportViewerPage" Culture="en-GB" %>
  • Ensuring that regional settings (control panel->regional and language options) is setup to English -United Kingdom. It all already was (regional, location, language and advanced tabs all setup to UK)
  • Ensuring the browser on the machine is setup to English -United Kingdom, it already was
  • Adding <globalization culture="en-GB" uiCulture="en-GB" /> to web.config
  • Updating BIOS (not my idea, but was getting to the point where I'd try anything! Basically, the BIOS has the date in the US format, so despite my reasoning that it's irrelevant due to regional settings, we upda

Large Dataset Downloaded Before Rendering Report's First Page



I'm hoping to understand the behavior of SSRS a bit better in the following scenario (SSRS 2008).  A single matrix (tablix) exists on the report.  No other objects are on the report.  That matrix is populated with 1.1 million rows of data totaling about 200MB.  Why does SSRS download the entire dataset prior to rendering the report's first page or am I missing something here?

When previewing the report, the local .data file bloats to 200MB indicating all dataset rows are being returned.  The matrix does not contain any sorting, all cell "can grow" and "can shrink" properties are set to false, no expressions are used anywhere, and even the table's column data types from which the data is being pulled are appropriate.  In other words, I believe I've reduced storage and CPU needs while eliminating elements that add overhead when rendering a report.

The specific scenario here is a researcher previewing the first few pages of data then choosing to download the entire dataset.  MS documentation I've read refers to "soft page breaks" when rendering as HTML and left me with the impression that perhaps SSRS needs to know the entire height of the dataset before it'll slice the report into pages.  It's odd to me though that it needs to download 1.1 millions rows of data befor

Determine if current user is part of audience


How can I determine if the current user is part of an audience or not?

Searching kept bringing me to this link: http://msdn2.microsoft.com/fr-ca/learning/ms499760.aspx  which is unavailable.

Any help or code is greatly appreciated.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend