Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Friday, March 23, 2012

report viewer control wont display report !

Hi friends
am trying to display reports from my report server in report view controls. following is my code in a button click

reportviewer1.ServerReport.ReportServerUrl = {http://localhost/reportserver};
reportviewer1.ServerReport.ReportPath = "\customer Details"
reportviewer1.RefreshReport();

its not giving my any error not displays any report!!
but if i set same info in design mode to report viewer control it works nicely!
whats missing here ?
Thanks for your help.finally figured out .following is what needs to be done

reportviewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
reportviewer1.ServerReport.ReportServerUrl = new System.Uri(@."http://localhost/reportserver");
reportviewer1.ServerReport.ReportPath = "\customer Details"
reportviewer1.RefreshReport();

Report Viewer Control in Local Mode ?

I run my reports in local mode and do something like this :

Code Snippet

//Local Processing mode for Reports

reportViewer.ProcessingMode = ProcessingMode.Local;

// Set RDL file based on handout/grid selected

if (gridRadioButton.Checked)

{

reportViewer.LocalReport.ReportPath = "Grid.rdlc";

}

else

{

//Handout

reportViewer.LocalReport.ReportPath = "Handout.rdlc";

}

//Refresh the report in order to show it to the user.

reportViewer.RefreshReport();

The problem is that both handout and grid is diiferent, Say User Selects the grid once it always shows the grid report. Even second time you change to handout still it shows the same Grid format and I debugged it and it picks the new report path but doesn't help? The application needs to be rerun to fix it.

Can anyone explain what is causing this and how to get rid of it.

Thanks,

Harsimrat

There are a couple of things you need to do:

1) I assume that the user can move back and forth between the reports at will? Not just change once? Therefore you should be checking to see if the user has actually *changed* before doing the appropriate reinitialization (IOW, do a comparison between current and new values)...

2) Reinitialization looks something like this:

Use the ReportViewer.Reset() method -- this is probably the bit you are missing Set the appropriate ReportPath, assuming these are not embedded resources, otherwise you want to set that Rebind the datasources -- this may or may not be required|||I tried adding Reset() and then it tells me cannot find the dataset. But without Reset() it runs fine. I think I need to rebind it somehow as my initial binding is done automatically. If you can please give an code example ?|||

Um, I did say you probably needed to re-bind... I think...

I would forget about the "automatically" bound altogether if you are switching between reports. But this is one of the reasons I told you to check to see whether they had actually *switched* reports -- because you don't want to do the reset and rebind if they have chosen the same report twice in a row. Does that make sense?

I will show you a code example in two parts. The first part shows you where I am actually refreshing the data, previous to changing the report. In my case the procedures for doing so are different depending on whether the source is a local XML file or from a data server --

I will pseudo code some parts of it that are not relevant to you... but this happens to be the reason why I need to switch reports in this particular form.... it doesn't matter that your reason is different, as it will still give you the idea of what you need to do, even in cases (like mine) that the datasets might be entirely different.

Code Snippet

If tsSourceIsServerInfo Then
Me.GetDataSetFromServer()
If [...] the last time they used a different report Then

Me.ReinitializeViewer(tThisReportName)
Else
Me.ReportViewer1.Visible = True ' it might not have been previously
End If
Else
Me.DataSet1.Reset()
Me.DataSet1.ReadXml(tsSource)
If [...] the last time they used a different report as above Then

Me.ReinitializeViewer(tThisReportName)
Else
Me.ReportViewer1.Visible = True
End If
End If

' carry on with initializing params here, then

Me.ReportViewer1.RefreshReport()

OK so far?

You see that the re-initialization is only done where necessary. Now for what happens inside the initialization:

Code Snippet

Private Sub ReinitializeViewer(ByVal tsReport As String)
Dim ReportDataSourceX = _

New Microsoft.Reporting.WinForms.ReportDataSource()
Me.ReportViewer1.Reset()
Me.ReportViewer1.LocalReport.ReportEmbeddedResource = tsReport

' change above line to

' Me.ReportViewer1.LocalReport.ReportPath = tsReport

' if not embedded

If tsReport is a certain report Then

ReportDataSourceX.Name = "Appropriate name for the data set for it"
ReportDataSourceX.Value = Me.BindingSourceDatabase
Else
ReportDataSourceX.Name = "Appropriate name here"
ReportDataSourceX.Value = Me.BindingSourceXML
End If


Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSourceX)
Me.ReportViewer1.Visible = True

End Sub

HTH,

>L<

Report Viewer Control - Export to PDF, Works on local IIS computer, but not another.

When exporting a report to a pdf file, I am experiencing what seems to be a "hang up" on the server. The code executes fine from my development machine, but when moved to the server I get this response. I also recieve this message if I click the refresh button. Acrobat could not open 'pdf9c9.tmp' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decode). To create an Adobe PDF document, go to the source application. Then print the document to Adobe PDF.

Here is my code for reference. It works fine on one IIS, but not another. What could I be missing?

Dim warningsAs Microsoft.Reporting.WebForms.Warning() =Nothing

Dim streamidsAsString() =Nothing

Dim mimeTypeAsString =Nothing

Dim encodingAsString =Nothing

Dim extensionAsString =Nothing

Dim deviceInfoAsString

Dim bytesAsByte()

Dim lrAsNew Microsoft.Reporting.WebForms.LocalReport

lr.ReportPath ="Report1.rdlc"

'lr.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource("DischargeSummary", ObjectDataSource1()))

deviceInfo ="<DeviceInfo><SimplePageHeaders>True</SimplePageHeaders></DeviceInfo>"

bytes = ReportViewer1.LocalReport.Render("PDF", deviceInfo, mimeType, encoding, extension, streamids, warnings)

Response.ClearContent()

Response.ClearHeaders()

Response.ContentType ="application/pdf"

Response.BinaryWrite(bytes)

Response.Flush()

Response.Close()

Check security permission on the server.

Report Viewer - need help

I would like to know if someone can send me a sample code on how to print a local report without previewing the data on the screen? This is a web application using .NET 2.0 and sql 2000. The client doesn't want to display the data, but send the report right to the default printer. The printer name can't be hard coded on the web.config file. The application needs to be able to read what is the default printer of the user and use that printer.

I am 99.99% sure that you cannot print directly from a web application. Here is a solution for windows application. See if you can make it to work.

http://msdn2.microsoft.com/en-us/library/ms252091(VS.80).aspx

|||

I have seen this solution. However, the solution needs to have the printer name already defined on the code. I am not very clear if .NET has a library that I can use to identify the users default printer at runtime. Do you know of a library name that I can use?

|||

Well as per my exprerinece with local reports you can not print it as you will not get print button on viewer. You will have to export it into Excel/PDF format and then you can take the print of it.

Report Viewer

I am trying to view my reports using the Report Viewer control. Here is my code :

<rsweb:ReportViewerID="ReportViewer1"runat="server"Font-Names="Verdana"Font-Size="8pt"Height="400px"ProcessingMode="Remote"Width="400px">

<ServerReportReportPath="https://ReportServer/Reports/Pages/Report.aspx?ItemPath=%2flovelyjubb%2fReports%2fQBRatings"ReportServerUrl="https://ReportServer/reports/Pages/Folder.aspx"/></rsweb:ReportViewer>

But when I run the code I get the error :

'The request fails with HTTP status 401 : unauthorized'

How do I prevent this error?

Thanks,

Mike

Does your server requires any authentication? If it does you can set the report programmatically from the code behind.

Here is some example i've used some time ago, it should still works :)

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
deimosReportViewer.Visible = false;
// Create a Web service proxy object and set credentials
ReportingService rs = new ReportingService();

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

// Return a list of catalog items in the report server database
CatalogItem[] items = rs.ListChildren("/", true);

// For each report, display the path of the report in a Listbox
foreach (CatalogItem ci in items)
{
if (ci.Type == ItemTypeEnum.Report)
catalogListBox.Items.Add(ci.Path);
}
}
}
protected void loadBtn_Click(object sender, EventArgs e)
{
string catalogItemPath = catalogListBox.SelectedItem.Text;

// Create a Web service proxy object and set credentials
ReportingService rs = new ReportingService();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

deimosReportViewer.Visible = true;
Uri reportServerUrl = new Uri("http://deimos/reportserver");
deimosReportViewer.ServerReport.ReportServerUrl = reportServerUrl;
deimosReportViewer.ServerReport.ReportPath = catalogItemPath;
}

Cheers,

Yani

|||Your code is similar to the code I used to use for RS 2000, but now I have switched to RS 2005 I have been advised to use the Report Viewer rather than code.sql

Wednesday, March 21, 2012

Report to Report Navigation problem

when I use "Navigation, Jump to URL" feature to navigate from one report to another, the .Net report service always alto generate the html code as: "TARGET="_top" which navigete the current frame page to the parent page. How can I make it generate the code like "TARGET="_self"? Because I display the report in a frame, and don't want let the report jump out of the frame when I click on the hyperlink.
Anybody can help? thanks.

This post is just below, they too talk about how to get the report to render in a certiain frame, as well as some discussion on the rc:LinkTarget Parameter that can help you out in pointing to the right place, or just google rc:LinkTarget and you will get some bolgs and stuff where they discuss this,...
I know for sure rc:LinkTarget can take therse arguments out of the box

rc:LinkTarget=_blank
rc:LinkTarget=_parent
rc:LinkTarget=_search
rc:LinkTarget=_self
rc:LinkTarget=_top



http://forums.asp.net/971389/ShowPost.aspx

Tuesday, March 20, 2012

Report Syntax help !!

Hello,
I was wondering if some one can direct me to a link where code samples are
posted or syntax checkers.
I've taken on this report project using stored procedures, the request is
base on inventory commission for sales reps.
The rep will be paid commission on a $ amt base on the invoice date. if the
invoice date is lets say prior to 4/10/04, the commission needs to be set to
2%, after that date commission is 3%. there's also a TargetAmt if they reach
the target amt commission percent is 4% and tally the AmtPaid to see when
they've reach the TargetAmt . I would a link to a place with reports simila
r
to this one I have to do for ideas.
Thanks in advance.There are a few ways you could do it...
If you want to have a date range indicating the commission, why not have a
table that you join to. Like this:
DateRangeCommission
(datefrom datetime,
dateto datetime,
commissionrate int)
Use dates that are sufficiently early/late to indicate "from the beginning
of time" or "until the end of time", such as '1-jan-1900' and '31-dec-2099'.
I've put commission as an int, but you call it whatever you want.
Then join like this:
select *
from orders o
join
daterangecommission c
on o.invoicedate between c.datefrom and c.dateto
As for checking the totals... that's a litle more complicated. My suggestion
would be to have a calculated field (persisted if possible) in the table
which gets populated with the running total. Then you can easily look at tha
t
field to see if the bonus commission is due.
But I don't know of sites with sample code to do all this, sorry.
Rob
"ITDUDE27" wrote:

> Hello,
> I was wondering if some one can direct me to a link where code samples are
> posted or syntax checkers.
> I've taken on this report project using stored procedures, the request is
> base on inventory commission for sales reps.
> The rep will be paid commission on a $ amt base on the invoice date. if th
e
> invoice date is lets say prior to 4/10/04, the commission needs to be set
to
> 2%, after that date commission is 3%. there's also a TargetAmt if they rea
ch
> the target amt commission percent is 4% and tally the AmtPaid to see whe
n
> they've reach the TargetAmt . I would a link to a place with reports simi
lar
> to this one I have to do for ideas.
> Thanks in advance.

Monday, March 12, 2012

Report show "#Error" on Pop Preview Window in Reporting Services (please reply me urge

i am using Assembly in RDL report. i add the reference of the assembly in report. and take a instance of assembly in report properties -> code tab.

and in text box expression in get the value from assembly.

when i click the report preview tab. its run fine and display my desired result.

but when i run the project for pressing the F5. it show "#Error" on Sepecified textbox.

i have assign rights to assembly for modify the two files "rssrvpolicy.config" and "rspreviewpolicy.config".

ihave write the code group in both files is written below:

<CodeGroup

class="UnionCodeGroup"

version="1"

PermissionSetName="FullTrust" Name="MyCustomCodeGroup"

Description="Code gorup for my custom extension">

<IMembershipCondition

class="UrlMembershipCondition"

version="1"

Url="\\great-t2\C$\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\HudReport_Assembly.dll"

/>

</CodeGroup>

any one suggest me how can i preview my desired result from running the project.

please reply me a soon as possibly

Regards,

Ali Ahmad

aliahmad wrote:

:(( i am very disappointed that no one reply me on this problem. so i think i apply this problem on other forums.

i am using Assembly in RDL report. i add the reference of the assembly in report. and take a instance of assembly in report properties -> code tab.

and in text box expression in get the value from assembly.

when i click the report preview tab. its run fine and display my desired result.

but when i run the project for pressing the F5. it show "#Error" on Sepecified textbox.

i have assign rights to assembly for modify the two files "rssrvpolicy.config" and "rspreviewpolicy.config".

ihave write the code group in both files is written below:

<CodeGroup

class="UnionCodeGroup"

version="1"

PermissionSetName="FullTrust" Name="MyCustomCodeGroup"

Description="Code gorup for my custom extension">

<IMembershipCondition

class="UrlMembershipCondition"

version="1"

Url="\\great-t2\C$\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\HudReport_Assembly.dll"

/>

</CodeGroup>

any one suggest me how can i preview my desired result from running the project.

please reply me a soon as possibly

Regards,

Ali Ahmad

Report show "#Error" on Pop Preview Window in Reporting Services (please reply me

i am using Assembly in RDL report. i add the reference of the assembly in report. and take a instance of assembly in report properties -> code tab.

and in text box expression in get the value from assembly.

when i click the report preview tab. its run fine and display my desired result.

but when i run the project for pressing the F5. it show "#Error" on Sepecified textbox.

i have assign rights to assembly for modify the two files "rssrvpolicy.config" and "rspreviewpolicy.config".

ihave write the code group in both files is written below:

<CodeGroup

class="UnionCodeGroup"

version="1"

PermissionSetName="FullTrust" Name="MyCustomCodeGroup"

Description="Code gorup for my custom extension">

<IMembershipCondition

class="UrlMembershipCondition"

version="1"

Url="\\great-t2\C$\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\HudReport_Assembly.dll"

/>

</CodeGroup>

any one suggest me how can i preview my desired result from running the project.

please reply me a soon as possibly

Regards,

Ali Ahmad

aliahmad wrote:

:(( i am very disappointed that no one reply me on this problem. so i think i apply this problem on other forums.

i am using Assembly in RDL report. i add the reference of the assembly in report. and take a instance of assembly in report properties -> code tab.

and in text box expression in get the value from assembly.

when i click the report preview tab. its run fine and display my desired result.

but when i run the project for pressing the F5. it show "#Error" on Sepecified textbox.

i have assign rights to assembly for modify the two files "rssrvpolicy.config" and "rspreviewpolicy.config".

ihave write the code group in both files is written below:

<CodeGroup

class="UnionCodeGroup"

version="1"

PermissionSetName="FullTrust" Name="MyCustomCodeGroup"

Description="Code gorup for my custom extension">

<IMembershipCondition

class="UrlMembershipCondition"

version="1"

Url="\\great-t2\C$\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\HudReport_Assembly.dll"

/>

</CodeGroup>

any one suggest me how can i preview my desired result from running the project.

please reply me a soon as possibly

Regards,

Ali Ahmad

Wednesday, March 7, 2012

Report Server FileShare Subscription example

I write .net code to create subsciption instead of report manager. Is there
any example talking about Subscription using Report Server FileShare ? I
only find the example of Report Server Email subscription in Books online. I
try the following code and I successfully create subscription. But when I
try to edit it, error is shown - "Object reference not set to an instance of
an object"
The code is as follows:
Dim FileNamePara As New ParameterValue
FileNamePara.Name = "File Name"
FileNamePara.Value = "Invoice Summary "
extensionParams(0) = FileNamePara
Dim PathPara As New ParameterValue
PathPara.Name = "Path"
PathPara.Value = "\\shkg013devfs\temp\may"
extensionParams(1) = PathPara
Dim renderPara As New ParameterValue
renderPara.Name = "RenderFormat"
renderPara.Value = "PDF"
extensionParams(2) = renderPara
settings.ParameterValues = extensionParams
Dim datRptGenTime As Date
datRptGenTime = DateAdd(DateInterval.Day, 1, Now)
Dim eventType As String = "TimedSubscription"
Dim matchData As String = "<ScheduleDefinition>" & _
"<StartDateTime>" & datRptGenTime.Year & "-" & _
IIf(datRptGenTime.Month < 10, "0" & datRptGenTime.Month,
datRptGenTime.Month) & "-" & _
IIf(datRptGenTime.Day < 10, "0" & datRptGenTime.Day, datRptGenTime.Day) &
"T08:00:00" & _
"+08:00</StartDateTime>" & _
"</ScheduleDefinition>"
Try
mRSProxyUtil.rs.CreateSubscription(ReportName, settings, sEmaiDesc,
eventType, matchData, parameters)
Catch e As SoapException
Console.WriteLine(e.Detail.InnerText.ToString())
End TryI'm not sure why you are getting the object reference error. Is RS
returning it?
Anyway, you are not using the correct setting names. To find the correct
names call GetExtensionSettings. This will return a list of extension names
that the extension excepts. There is a flag that will tell you if the
setting is required or not.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"May Liu" <MayLiu@.discussions.microsoft.com> wrote in message
news:E022B2B3-B882-4E6D-A836-03CC0AE19675@.microsoft.com...
>I write .net code to create subsciption instead of report manager. Is
>there
> any example talking about Subscription using Report Server FileShare ?
> I
> only find the example of Report Server Email subscription in Books online.
> I
> try the following code and I successfully create subscription. But when I
> try to edit it, error is shown - "Object reference not set to an instance
> of
> an object"
> The code is as follows:
> Dim FileNamePara As New ParameterValue
> FileNamePara.Name = "File Name"
> FileNamePara.Value = "Invoice Summary "
> extensionParams(0) = FileNamePara
> Dim PathPara As New ParameterValue
> PathPara.Name = "Path"
> PathPara.Value = "\\shkg013devfs\temp\may"
> extensionParams(1) = PathPara
> Dim renderPara As New ParameterValue
> renderPara.Name = "RenderFormat"
> renderPara.Value = "PDF"
> extensionParams(2) = renderPara
> settings.ParameterValues = extensionParams
> Dim datRptGenTime As Date
> datRptGenTime = DateAdd(DateInterval.Day, 1, Now)
> Dim eventType As String = "TimedSubscription"
> Dim matchData As String = "<ScheduleDefinition>" & _
> "<StartDateTime>" & datRptGenTime.Year & "-" & _
> IIf(datRptGenTime.Month < 10, "0" & datRptGenTime.Month,
> datRptGenTime.Month) & "-" & _
> IIf(datRptGenTime.Day < 10, "0" & datRptGenTime.Day, datRptGenTime.Day) &
> "T08:00:00" & _
> "+08:00</StartDateTime>" & _
> "</ScheduleDefinition>"
> Try
> mRSProxyUtil.rs.CreateSubscription(ReportName, settings, sEmaiDesc,
> eventType, matchData, parameters)
> Catch e As SoapException
> Console.WriteLine(e.Detail.InnerText.ToString())
> End Try

Monday, February 20, 2012

Report selection formula

this does not show actual code, I have simplified it to post here.

I have linked two tables in my report

MasterTable
ID : Person Name

DetailTable
ID : workDone

and using a selection formula
{MasterTable.ID} > 1

Fields In report are being displayed.

ID | PersonName | WorkDone

the problem is if Detail Table does not have any related record. Report does not show any thing at all. I expect to view ID and PersonName fields with WorkDone field empty.

can any body help. Thanks a lotIf you use a JOIN or RIGHT JOIN to link the 2 tables together, it will only return a row from the first table (MasterTable ) if there's a match in the second table (DetailTable). If youchange it to a LEFT JOIN, it will return all rows from both Tables.

Ex.

Master Table Rows:
ID | PersonName
-----
01 | Bob
02 | Joe
03 | Bill

DetailTable Rows:
ID | WorkDone
----
01 | Data1
03 | Data3

SELECT M.ID, M.PersonName, D.WorkDone
FROM MasterTable As M
LEFT JOIN DetailTable As D ON M.ID = D.ID

will give you this:

Results:
ID | PersonName | WorkDone
--------
01 | Bob | Data1
02 | Joe | NULL <-- Returns a NULL if there is no matching row in DetailTable
03 | Bill | Data3|||Thanks a lot Malleyo

You are right about SQL part but i am writing a record selection formula in crystal report. can you please help me in this regard.

thanks|||go to your table expert or table expert.. you know the window with the table linked on it.
right clic on one link , link option and select RIGHT JOIN. it will be propqgqted if you've set more than one link.

Luc|||thanks a lot to all those help me, it works now

Report re-opening problem

Hi,

I have created a RDL report and successfully deployed it in reporting server. The following code is used to open the Report.

private void Form1_Load(object sender, EventArgs e){

this.reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;

this.reportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/ReportServer");

this.reportViewer1.ServerReport.ReportPath = "/Import Run Reports/ImportRunReport";

Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[2];param[0] = new Microsoft.Reporting.WinForms.ReportParameter("RunId", "195900,195904,195711,195707");param[1] = new Microsoft.Reporting.WinForms.ReportParameter("ReportType", "Summary");

reportViewer1.ServerReport.SetParameters(param);

reportViewer1.RefreshReport();

}

Very first time the Report is opening successfully. Once I close the window and again i am trying to open the report i am getting the following error "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server."

Could you Please help me in this regard.

Dear Ravi,

I had the same issue as you once. I am going to past some code on here that I use for my report viewer.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using Microsoft.Reporting.WinForms;

namespace Detail_Report_Viewer

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void Form1_Load(object sender, EventArgs e)

{

this.reportViewer1.RefreshReport();

}

private void runReport_Click(object sender, EventArgs e)

{

reportURL.Text = "/Import Run Reports/ImportRunReport";

reportViewer1.ProcessingMode =

Microsoft.Reporting.WinForms.ProcessingMode.Remote;

reportViewer1.ServerReport.ReportServerUrl =

new Uri (@."http://localhost/ReportServer");

reportViewer1.ServerReport.ReportPath = reportURL.Text;

Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[2];param[0] = new Microsoft.Reporting.WinForms.ReportParameter("RunId", "195900,195904,195711,195707");param[1] = new

Microsoft.Reporting.WinForms.ReportParameter("ReportType", "Summary");

reportViewer1.ServerReport.SetParameters(param);

reportViewer1.RefreshReport();

}

}

}

I was using a textbox to display the url, but you can remove that if you feel it to be necessary. I updated it with your settings.

Report re-opening problem

Hi,

I have created a RDL report and successfully deployed it in reporting server. The following code is used to open the Report.

private void Form1_Load(object sender, EventArgs e){

this.reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;

this.reportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/ReportServer");

this.reportViewer1.ServerReport.ReportPath = "/Import Run Reports/ImportRunReport";

Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[2];param[0] = new Microsoft.Reporting.WinForms.ReportParameter("RunId", "195900,195904,195711,195707");param[1] = new Microsoft.Reporting.WinForms.ReportParameter("ReportType", "Summary");

reportViewer1.ServerReport.SetParameters(param);

reportViewer1.RefreshReport();

}

Very first time the Report is opening successfully. Once I close the window and again i am trying to open the report i am getting the following error "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server."

Could you Please help me in this regard.

Dear Ravi,

I had the same issue as you once. I am going to past some code on here that I use for my report viewer.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using Microsoft.Reporting.WinForms;

namespace Detail_Report_Viewer

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void Form1_Load(object sender, EventArgs e)

{

this.reportViewer1.RefreshReport();

}

private void runReport_Click(object sender, EventArgs e)

{

reportURL.Text = "/Import Run Reports/ImportRunReport";

reportViewer1.ProcessingMode =

Microsoft.Reporting.WinForms.ProcessingMode.Remote;

reportViewer1.ServerReport.ReportServerUrl =

new Uri (@."http://localhost/ReportServer");

reportViewer1.ServerReport.ReportPath = reportURL.Text;

Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[2];param[0] = new Microsoft.Reporting.WinForms.ReportParameter("RunId", "195900,195904,195711,195707");param[1] = new

Microsoft.Reporting.WinForms.ReportParameter("ReportType", "Summary");

reportViewer1.ServerReport.SetParameters(param);

reportViewer1.RefreshReport();

}

}

}

I was using a textbox to display the url, but you can remove that if you feel it to be necessary. I updated it with your settings.

Report Rendering (II)

Hi,

I have been using the following code, (thanks to Shyam), to display address fields. This works great when using preview in BIDS, but the address shows on one continious line when the report is redered in Reporting Services.

=First(Fields!Name.Value) & IIf(First(Fields!Address1.Value) <> "", Chr(10) & Chr(13) & First(Fields!Address1.Value), "") &
IIf(First(Fields!Address2.Value) <> "", Chr(10) & Chr(13) & First(Fields!Address2.Value), "") &
IIf(First(Fields!Address3.Value) <> "", Chr(10) & Chr(13) & First(Fields!Address3.Value), "") &
IIf(First(Fields!Town.Value) <> "", Chr(10) & Chr(13) & First(Fields!Town.Value), "") &
IIf(First(Fields!County.Value) <> "", Chr(10) & Chr(13) & First(Fields!County.Value), "") &
IIf(First(Fields!Post_Code.Value) <> "", Chr(10) & Chr(13) & First(Fields!Post_Code.Value),

Any one any ideas?

Thanks

Did you try vbCRLF instead of chr(10) & 13?

http://blogs.infinite-x.net/category/dynamics-crm/reporting/

cheers,

Andrew

Report Refresh through code in reporting services

I use some editor to edit the data in the backend. I view the report in sharepoint portal using url access of the report in reporting services with the toolbar disabled by rc:toolbar=false. Now, as and when I edit the data of the report using an editor, I want the report to be updated with the new data. This I want to do it by placing a button or some link in the Sharepoint, clicking which should update the report with the new data. Is there any parameter like rc:refresh which will refresh the report?
--
Message posted via http://www.sqlmonster.comYes, rs:ClearSession=true will refresh the report.
--
Brian Welcker
Group Program Manager
Microsoft SQL Server
This posting is provided "AS IS" with no warranties, and confers no rights.
"Varma via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:9fcebb16b4f6418fb26b01a1a4841f5d@.SQLMonster.com...
>I use some editor to edit the data in the backend. I view the report in
>sharepoint portal using url access of the report in reporting services with
>the toolbar disabled by rc:toolbar=false. Now, as and when I edit the data
>of the report using an editor, I want the report to be updated with the new
>data. This I want to do it by placing a button or some link in the
>Sharepoint, clicking which should update the report with the new data. Is
>there any parameter like rc:refresh which will refresh the report?
> --
> Message posted via http://www.sqlmonster.com