Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Thursday, March 29, 2012

Can I inherited from a template report?

I must make many report in my project.

All the reports must have header of company name and footer of page number.

Can I desgin a template custom report, then all reports in my project are inherited from it?

This is very easy to do if you are developing your reports in Visual Studio. The templates for reports are stored at the following path:

C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject\

You can create a template report and save it in this location, and then when you want to use it, from within your report project, click on the 'Project' menu option, and select 'Add New Item...'. When the dialog opens, you should see all .rdl files located in the above directory.

Hope that helps - Dan

Sunday, March 25, 2012

Can I dynamically change the width of objects?

I have a problem using the table object. I have columns that I sometimes want to show, and I want the page to run off the edge and be two pages. However, usually I'm hiding many of the columns and the table "shrinks" enough to fit on one page. When this happens, the table looks right on the first page, but I get blank pages after it, because the report itself will not shrink.
Is there a way to dynamically change the size of the table and report so that it doesn't print blank pages if it doesn't need to?
Thanks,
John
Unfortunately, there is no way to shrink the body size of the report. This is under consideration for a future release.|||

We had same situation where user would select few columns out of some possible 50 data columns.

We ended with doing some logic programmatically.

1) GetReportDefinition() of report containing 50 columns

2) As rdl from #1 is XML, we manipluate the xml by deleting the unselected columns and reordering them as per selected display order

3) publish the new report with unique name to a temp folder in reporing server

4) Now generate the report

5) then delete the report from temp folder

|||

We have the same issue with a client where a dense grid in 12.5 in body with borders it is 13in. The client uses IE6.

I read that IE7 supports Shrink-to-fit. Would that work with SSRS reports pending the Shrink-to-fit functionality printing in SSRS?

Thanks

Can I dynamically change the width of objects?

I have a problem using the table object. I have columns that I sometimes want to show, and I want the page to run off the edge and be two pages. However, usually I'm hiding many of the columns and the table "shrinks" enough to fit on one page. When this happens, the table looks right on the first page, but I get blank pages after it, because the report itself will not shrink.
Is there a way to dynamically change the size of the table and report so that it doesn't print blank pages if it doesn't need to?
Thanks,
John
Unfortunately, there is no way to shrink the body size of the report. This is under consideration for a future release.|||

We had same situation where user would select few columns out of some possible 50 data columns.

We ended with doing some logic programmatically.

1) GetReportDefinition() of report containing 50 columns

2) As rdl from #1 is XML, we manipluate the xml by deleting the unselected columns and reordering them as per selected display order

3) publish the new report with unique name to a temp folder in reporing server

4) Now generate the report

5) then delete the report from temp folder

|||

We have the same issue with a client where a dense grid in 12.5 in body with borders it is 13in. The client uses IE6.

I read that IE7 supports Shrink-to-fit. Would that work with SSRS reports pending the Shrink-to-fit functionality printing in SSRS?

Thanks

Can I dynamically change the width of objects?

I have a problem using the table object. I have columns that I sometimes want to show, and I want the page to run off the edge and be two pages. However, usually I'm hiding many of the columns and the table "shrinks" enough to fit on one page. When this happens, the table looks right on the first page, but I get blank pages after it, because the report itself will not shrink.
Is there a way to dynamically change the size of the table and report so that it doesn't print blank pages if it doesn't need to?
Thanks,
John
Unfortunately, there is no way to shrink the body size of the report. This is under consideration for a future release.|||

We had same situation where user would select few columns out of some possible 50 data columns.

We ended with doing some logic programmatically.

1) GetReportDefinition() of report containing 50 columns

2) As rdl from #1 is XML, we manipluate the xml by deleting the unselected columns and reordering them as per selected display order

3) publish the new report with unique name to a temp folder in reporing server

4) Now generate the report

5) then delete the report from temp folder

|||

We have the same issue with a client where a dense grid in 12.5 in body with borders it is 13in. The client uses IE6.

I read that IE7 supports Shrink-to-fit. Would that work with SSRS reports pending the Shrink-to-fit functionality printing in SSRS?

Thanks

Monday, March 19, 2012

Can I add an autonumber to a view?

Hi, I wish to build a datagrid, in an ASP.NET web page, in which I can display a row from a table and when I press a button it will move forward one row. The table is not currently sorted and I need it to be alpahbetical by surname so I thought if I created a view I could sort the table alphabetically on the 'Surname' column. I know that ADO.NET when used in disconnected mode doesn't have a cursor which remembers the last row it was on so I thought if I could create an autonumber on the view then I could use this in the 'where' clause to tell SQLserver which line I wished to select by taking the previous number and adding one. Is this the best way to do this and if so could some one give advice on how to write the line of the query that will add in an autonumber column

thanks
Johnwhy don't you just use the standard paging method with a pagesize of one?

(no views, don't have autonumbering unless you feel like generating one from a cursor)|||The table has over 100,000 rows in it so I don't wish to pull all these into a dataset as I thought this would be far too big if lots of users were going to use the website at once. I thought using paging it stepped through a dataset not the actual SQL table. I just want a way that I can find the next row each time.

I will look at the paging method. thanks

John

Saturday, February 25, 2012

Can anyone help me with connecting to a database to search?

I'm trying to make this piece of code work, I get all of it except how I get the data from the database, what I wish to do is. On page load I wish to take the value of a querystring in the page URL called ProductID and search a database to see if it exists in a specifical table and column, if it exists I wish to make a button not visible. the code I am using is:

#############

protectedvoid Page_Load(object sender,EventArgs e)

{

// Get the querystring value

String inQueryString = Request.QueryString["ProductID"];

// Get the data from the database, using the above value

DataTable data = ??

The datasource I want to connect to is SqlDataSource1, and the table I want to search is "Reviews". I want to search in the column "ProductID" and search for the ProductID from the URL query string above.

// Did we find a product in the database?

if (data !=null &&

data.Rows.count > 0)

{

// Code to display the product's information

// We found a product, so we need to hide a button

Button5.Visible =false;

}

}

##########################

Please can somebody fill in the missing bit for me so i know how it should be, i've searched the quickstart tutorial on the menu above and I still don't understand it, as it doesn't show anything like what I want to do, and I have looked at numerous websites about the matter. If you don't have time that is okay, but If somebody does have the time to show me what I need, I would be very greatfull.

Regards

Daniel coates

anyone got any ideas? surely somebody must know what I need to do!

Regards

Dan

Friday, February 24, 2012

can any one help me with this error please

i get this error sometimes when opening my site. however when i refresh or enter again the page opens normally. please is there anyone who can help me on this.

thanks


Server Error in '/' Application.


A transport-level error has occurred when sending the request to the

server. (provider: TCP Provider, error: 0 - An existing connection was forcibly

closed by the remote host.)

Description: An unhandled

exception occurred during the execution of the current web request. Please

review the stack trace for more information about the error and where it

originated in the code.

Exception Details: System.Data.SqlClient.SqlException: A transport-level

error has occurred when sending the request to the server. (provider: TCP

Provider, error: 0 - An existing connection was forcibly closed by the remote

host.)

Source Error:

An unhandled

exception was generated during the execution of the current web request.

Information regarding the origin and location of the exception can be

identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)]System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857578System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735190System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188System.Data.SqlClient.TdsParserStateObject.ThrowExceptionAndWarning() +13System.Data.SqlClient.TdsParserStateObject.WriteSni() +638257System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte flushMode) +265System.Data.SqlClient.TdsParserStateObject.ExecuteFlush() +51System.Data.SqlClient.TdsParser.TdsExecuteSQLBatch(String text, Int32 timeout, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj) +241System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +122System.Data.SqlClient.SqlCommand.ExecuteReader() +84GksOfferNew.top.Page_Load(Object sender, EventArgs e) in top.ascx.vb:119System.Web.UI.Control.OnLoad(EventArgs e) +99System.Web.UI.Control.LoadRecursive() +47System.Web.UI.Control.LoadRecursive() +131System.Web.UI.Control.LoadRecursive() +131System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


Version Information: Microsoft .NET Framework Version:2.0.50727.42;

ASP.NET Version:2.0.50727.210

Hi,

this could be security issue if you are using WIndows 2003 Server --> http://download.microsoft.com/download/f/1/0/f10c4f60-630e-4153-bd53-c3010e4c513b/ReadmeSQLEXP2005.htm#sse_dbengine

HTH, Jens K. Suessmeyer.


http://www.sqlserver2005.de

can any body tell my why this page does´t uppdate into sql

can any body tell my why this page does´t uppdate into my sql
i get no error but it does´t uppdate the records :(


<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<title>Updating a Row of Data with Validation</title>
<style type="text/css">
#editPanel {
width:90%; padding:10; background:khaki;
border:thin outset}
#posted {
background:lightgreen; border:thin inset}
</style
<script language="C#" runat="server">
/* *********** Data base config ************ */

string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

/* *********** define DataBase Sql/Access data ************ */

string TheID;

protected void Page_Load ( object src, EventArgs e )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ("SELECT * FROM cars ORDER BY MessageDate desc",myConn);
myCmd.Connection = myConn;
TheID = Request.QueryString [ "TheID" ] ;
if ( !IsPostBack )
{
if ( TheID == null )
{
bindGrid ( );
loadPanel.Visible = true;
editPanel.Visible = false;
postPanel.Visible = false;
}
else
{
getMessage ( Request.QueryString [ "TheID" ] );
loadPanel.Visible = false;
editPanel.Visible = true;
postPanel.Visible = false;
}
}
else
{
loadPanel.Visible = false;
editPanel.Visible = false;
postPanel.Visible = true;
}
}

public void bindGrid ( )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ("SELECT TOP 10 * FROM cars",myConn);
SqlDataReader rdr;

myCmd.CommandText = "SELECT TOP 10 * FROM cars";

myConn.Open();

rdr = myCmd.ExecuteReader ( );
myGrid.DataSource = rdr;
myGrid.DataBind ( );
rdr.Close();
myConn.Close();

/*
myCmd.CommandText = "SELECT * FROM cars";
myConn.Open();

myGrid.DataSource=myCmd.ExecuteReader ( );
myGrid.DataSource = myCmd.ExecuteReader ( CommandBehavior.CloseConnection );
myGrid.DataBind ( );
*/
}

public void getMessage ( String TheID )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ( );
SqlDataAdapter myAdapter = new SqlDataAdapter ("select * from cars where ID=" + TheID, myConn );
DataTable msgDetails = new DataTable ( );
myAdapter.Fill ( msgDetails );
DataRowView myRow = msgDetails.DefaultView [ 0 ] ;

msgFastnumer.Value = myRow [ "Fastnumer" ].ToString ( );
msgTegund.Value = myRow [ "Tegund" ].ToString ( );
editPanel.DataBind ( );
}

public void updateMessage ( object src, EventArgs e )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ( );

myCmd.Connection = myConn;

SqlDataAdapter myAdapter = new SqlDataAdapter ("select * from cars where ID=" + TheID, myConn );
DataTable msgDetails = new DataTable ( );
myAdapter.Fill ( msgDetails );
DataRowView myRow = msgDetails.DefaultView [ 0 ] ;

SqlDataReader rdr;

if ( Page.IsValid )
{
myCmd.CommandText = "UPDATE cars SET Fastnumer=@.Fastnumer, Tegund=@.Tegund where id=" + TheID;

msgFastnumer.Value = myRow [ "Fastnumer" ].ToString ( );
msgTegund.Value = myRow [ "Tegund" ].ToString ( );

myCmd.Parameters.Add ( "@.Fastnumer", SqlDbType.NVarChar ).Value = msgFastnumer.Value;
myCmd.Parameters.Add ( "@.Tegund", SqlDbType.NVarChar ).Value = msgTegund.Value;

myConn.Open ( );
rdr = myCmd.ExecuteReader ( );
myGrid.DataSource = rdr;
myGrid.DataBind ( );
rdr.Close();
myConn.Close ( );

}
bindPostPanel ( TheID );
}

public void bindPostPanel ( String TheID )
{
string ServerName = "xxx"; // SQL server name
string Database = "xxx"; // SQL Database Name
string user = "xxx"; // SQL User name
string Pass = "xxx"; // SQL Password

SqlConnection myConn = new SqlConnection("server=" + ServerName + ";database=" + Database + ";UID=" + user + ";PWD=" + Pass + ";");
SqlCommand myCmd = new SqlCommand ( );
SqlDataReader rdr;
myCmd.CommandText = "SELECT * FROM cars WHERE Id='" + TheID + "'";

myCmd.Connection = myConn;

myConn.Open();

rdr = myCmd.ExecuteReader ( CommandBehavior.SingleRow );
listDetails.DataSource = rdr;
listDetails.DataBind ( );
rdr.Close();
myConn.Close();

/*
myConn.Open ( );
listDetails.DataSource = myCmd.ExecuteReader ( CommandBehavior.SingleRow );
listDetails.DataBind ( );
myConn.Dispose ( );
*/

}
</script>
</head>
<body>
<div class="header"><h3>ADO.NET Primer:
<span class="hilite">Editing an Existing Record</span></h3>
</div>
<hr size="1" width="90%">
<br>
<center>
<asp:panel id="loadPanel" runat="server">
<h5>Select a Record to Edit</h5>
<asp:datagrid id="myGrid" runat="server" width="90%" cellpadding="5" gridlines="vertical" bordercolor="black"
borderwidth="1" font-size="8pt" backcolor="ghostwhite" alternatingitemstyle-backcolor="lightgray"
autogeneratecolumns="false">
<headerstyle backcolor="darkslategray" forecolor="khaki" height="25" font-bold />
<columns>
<asp:boundcolumn headertext="Date" datafield="Innsett" dataformatstring="{0:d}" />
<asp:hyperlinkcolumn headertext="Fastnumer" datanavigateurlfield="id" datanavigateurlformatstring="aspxtest.aspx?TheID={0}"
datatextfield="Fastnumer" />
<asp:boundcolumn headertext="Tegund" datafield="Tegund" />
</columns>
</asp:datagrid>
<p align="center">Back to top</p>
</asp:panel
<asp:panel id="editPanel" runat="server">
<h5>To save changes to the database, press Update.</h5>
<form runat="server">
<input type="hidden" id='msgDate' runat="server">
<table width="85%" cellspacing="1" cellpadding="3" border="0">
<col width="40%" align="right">
<col width="60%">
<tr>
<td>Fastnumer:</td>
<td><input id="msgFastnumer" runat="server">
<asp:requiredfieldvalidator runat="server" controltovalidate="msgFastnumer" errormessage="Sender's name cannot be blank. "
display="none" /></td>
</tr>
<tr>
<td>Your email address:</td>
<td><input id="msgEmail" runat="server">
<asp:regularexpressionvalidator runat="server" controltovalidate="msgEmail" validationexpression="^[\w-]+@.[\w-]+\.(com|net|org|edu|mil)$"
errormessage="Please enter a valid e-mail address. " display="none" /></td>
</tr>
<tr>
<td>Tegund:</td>
<td><input id="msgTegund" runat="server"></td>
</tr>
<tr>
<td>Your message:</td>
<td><textarea id="msgBody" rows="5" cols="35" runat="server"></textarea></td>
</tr>
</table>
<p>
<input type="submit" value="Update" runat="server" onServerClick="updateMessage">
<input type="reset" value="Cancel" onClick="self.location.replace ( 'aspxtest.aspx' ) "></p>
<asp:validationsummary runat="server" displaymode="SingleParagraph" showmessagebox="true" showsummary="false" />
</form>
</asp:panel>
<asp:panel id="postPanel" runat="server">
<h5>Thank you for editing your comments. This record has been updated.</h5>
<asp:datalist id="listDetails" width="85%" runat="server">
<itemtemplate>
<table id="posted" width="100%" cellspacing="1" cellpadding="5" border="0">
<col width="35%" align="right">
<tr>
<td>Date:</td>
<td><%# DataBinder.Eval ( Container.DataItem, "Innsett", "{0:d}" ) %></td>
</tr>
<tr>
<td>Name:</td>
<td><%# ( ( IDataRecord ) Container.DataItem ) [ "Fastnumer" ] %></td>
</tr>
<tr>
<td>Tegund:</td>
<td><%# ( ( IDataRecord ) Container.DataItem ) [ "Tegund" ] %></td>
</tr>
</table>
</itemtemplate>
</asp:datalist>
<p>
Back to Edit View
Select Another Record
</p>
</asp:panel>
</center>
<br>
<hr size="1" width="90%">
</body>
</html>

um.. this is unreadable. Are you sure you're returning any data?|||yes it does read the data out of the sql but it doesn´t uppdate the records
i am very new in asp.net i got this code from some tutorial page i dont remember where be cose i have been reading so many tutorial websites.

here you can see the code in action
http://demo.xodus.is/xman-manager/aspxTest.aspx|||why are you doing a "select * from ..." and then an update...why not just an update and call the bindgrid sub at the end..

hth|||i am very new in asp.net can you show me how that is done|||just build your sql stmt use parameterized query and execute it..
sample code:


dim mysql as string
'set up your connection string
Dim oCmd As New OledbCommand(sSQL, oCnn)
mysql="update <table> set col1=@.colval,col2=@.colval where Id=@.Id"
'Add up the parameter, associated it with its value
oCmd.Parameters.Add("col1",value1 )
oCmd.Parameters.Add("col2",value2 )
oCmd.Parameters.Add("id",Idvalue )
oCnn.Open()
oCmd.ExecutenonQuery()
oCnn.Close()

you need to modify the above code with your table names, col names and values from textboxes ..etc and as i said earlier call the bindgrid() again when done.

hth|||thx allot it does work now

Can an ASP.NET application running on WinXP+IIS5 access to SSRS web service?

Hi,
I am developing a web application on windows XP. A page within my
application needs to access to SSRS running on the same machine. Once the
web application tries to consume the SSRS web services, I receive the
following error:
System.Web.Services.Protocols.SoapException: The permissions granted to user
DEV1\ASPNET' are insufficient for performing this operation. -->
Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The
permissions granted to user 'ALISGD\ASPNET' are insufficient for performing
this operation.
The user DEV1\ASPNET is member of
"SQLServer2005ReportingServicesWebServiceUser$DEV1" local NT groups. Also I
added the user "DEV1\ASPNET" to browsers and also "System Administrator"
role within SSRS web portal. still the same problem.
I do have the following code on my web service proxy code:
reportingService.UseDefaultCredentials = true;
Obviously I can solve the problem by using this code:
System.Net.ICredentials netCredential = new
System.Net.NetworkCredential("Username","Password","Domain");
reportingService.Credentials = netCredential;
But I like to find the root of the problem and solve it properly.
Is there any way that a web application running on IIS5+XP as user "ASPNET'
access to SSRS web service?
Any help would be appreciated,
MaxHello Max,
Please check the following settings:
1. Make sure the ASPNET account is under the RSExec Role in MASTER, MSDB,
ReportServer, ReportTempDB database.
2. Go to Local Policy. For "Act as part of Operating System", added ASPNET
and SYSTEM. For "Impersonate a client after authentication", added SYSTEM.
3. Restarted IIS and RS.
Hope this helps.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi Wei,
I have users who don't have "Act as part of Operating System", and they can
work with SSRS web services.
"Act as part of Operating System" works, but I expect there is less
previlage setting for ASPNET user that can intercat with SSRS.
Kind Regards,
Max
"Wei Lu [MSFT]" <weilu@.online.microsoft.com> wrote in message
news:NR0QuNn0HHA.4844@.TK2MSFTNGHUB02.phx.gbl...
> Hi ,
> How is everything going? Please feel free to let me know if you need any
> assistance.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>|||Hello Max,
I would like to know what permission your other user have.
If you don't grant the "Act as part of Operating System", did this issue
appeared?
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hi ,
How is everything going? Please feel free to let me know if you need any
assistance.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Thursday, February 16, 2012

can a report read parameters from POST as opposed to GET?

My scenarios is that I have to have an ADHOC report page, which will
allow the user to select various attributes, and I have to then create
the SQL clause on the fly, based off these selected attributes. I then
have to have the report in reporting services run off of that generated
SQL clause.
I have two ideas how I can do this, but I am looking for the most
efficient.
My first idea, and the one I assume I will have to go with is this.
When the user clicks the run button, the SQL clause will be built based
on their selections. That SQL clause will then get passed into a
stored proc which will act like a "middle man", this "middle man"
procedure will store the clause into a "holding" table. The Reporting
Services report will then have to run, use a procedure that reads from
this "holding" table and uses the SQL clause, executes it, and if
successful, deletes it from the holding table, ready for the next run
of the page.
The other approach I am thinking of, but am not sure will work is
basically passing the generated SQL query to the report as a POST
variable. I am not sure if this will work or not since I haven't tried
it before.
does anyone know if you can pass in POST variables as opposed to GET
variables when calling a report as a url?answered my own question by searching through the help (which I should
have done in the first place). So far it looks like I can POST the SQL
query that I want....but the help file mentions something about a 2000
char limit, for even POST...anyone have any experience with a similar
situation?

Friday, February 10, 2012

Calling the same report in a batch (rs2005) from aspx page

Hi,
what would be the best way to call the same report with diffrent
parameters.
right now I am calling the RenderInvoice which is called in a loop
(view code below)
is there a better way to do this, like a batch process?
this works, and it does 50 reports in about one minute, I wonder if I
can make it go faster.
or it's just an issue of computer hardware.
Thanks.
protected Byte[] RenderInvoice(ReportExecutionService rs,string
shipmentId)
{
ParameterValue[] parameters = new ParameterValue[2];
parameters[0] = new ReportExecutionWS.ParameterValue();
parameters[0].Name = "ShipmentId";
parameters[0].Value = shipmentId;
parameters[1] = new ReportExecutionWS.ParameterValue();
parameters[1].Name = "ShowLogo";
parameters[1].Value = "True";
// set report parameters
rs.SetExecutionParameters(parameters, "en-us");
// set rendering info
Byte[] result = null;
String format = "PDF";
String devInfo = "<DeviceInfo><Toolbar>False</Toolbar></
DeviceInfo>";
String extension = "";
String encoding = "";
String mimeType = "";
Warning[] warnings = null;
string[] streamIDs = null;
result = rs.Render(format, devInfo, out extension, out
encoding, out mimeType, out warnings, out streamIDs);
return result;
}You are running the reports one after another. A minute for 50 reports
sounds pretty good to me. RS could do these in parallel but your app would
need to do request the rendering asynchronously. My suggestion is to leave
it alone. I don't think a whole lot of complexity to speed it up more is
worth the effort.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<rperetz@.gmail.com> wrote in message
news:1182807919.166551.199320@.g4g2000hsf.googlegroups.com...
> Hi,
> what would be the best way to call the same report with diffrent
> parameters.
> right now I am calling the RenderInvoice which is called in a loop
> (view code below)
> is there a better way to do this, like a batch process?
> this works, and it does 50 reports in about one minute, I wonder if I
> can make it go faster.
> or it's just an issue of computer hardware.
> Thanks.
>
> protected Byte[] RenderInvoice(ReportExecutionService rs,string
> shipmentId)
> {
> ParameterValue[] parameters = new ParameterValue[2];
> parameters[0] = new ReportExecutionWS.ParameterValue();
> parameters[0].Name = "ShipmentId";
> parameters[0].Value = shipmentId;
> parameters[1] = new ReportExecutionWS.ParameterValue();
> parameters[1].Name = "ShowLogo";
> parameters[1].Value = "True";
> // set report parameters
> rs.SetExecutionParameters(parameters, "en-us");
> // set rendering info
> Byte[] result = null;
> String format = "PDF";
> String devInfo = "<DeviceInfo><Toolbar>False</Toolbar></
> DeviceInfo>";
> String extension = "";
> String encoding = "";
> String mimeType = "";
> Warning[] warnings = null;
> string[] streamIDs = null;
>
> result = rs.Render(format, devInfo, out extension, out
> encoding, out mimeType, out warnings, out streamIDs);
> return result;
> }
>