I want to render a PDF report and view the copy of the report in the HTML
viewer. What I did is to use rs.Render(...) to get the PDF report and the
SessionID, and then pass the SessionID to the URL string and run the URL.
But the rs:SessionID=xxxxx command does not work, it alway create a new
session for the report.
This part of the code works fine to generate a PDF file for me and save a
session id in m_SessionID:
byte[] results = null;
string historyID = null;
string devInfo = @."<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
SessionHeader sh = new SessionHeader();
rs.SessionHeaderValue = sh;
results = rs.Render(
this.ReportConfig.ReportName,
"PDF",
historyID,
devInfo,
parameters,
credentials,
showHideToggle, out encoding, out mimeType, out
reportHistoryParameters,
out warnings,
out streamIDs);
m_SessionID = rs.SessionHeaderValue.SessionId;
But when I use the generated sesionid for the URL access like this:
url = "http://guoxp.softbrandsamer.com/reportserver?%2fInvItmb&rs:Command=Render&r
s:SessionID=" + m_SessionID
it will create a new instance. And when I looked at the SessionData table in
the ReportServerTempDB, a new session is created.
How to make it work? Please help. Thanks,
LianghongDid you ever find a work around for this. It doesn't seem to be working for
me either.
"Guo, Lianghong" wrote:
> I want to render a PDF report and view the copy of the report in the HTML
> viewer. What I did is to use rs.Render(...) to get the PDF report and the
> SessionID, and then pass the SessionID to the URL string and run the URL.
> But the rs:SessionID=xxxxx command does not work, it alway create a new
> session for the report.
> This part of the code works fine to generate a PDF file for me and save a
> session id in m_SessionID:
> byte[] results = null;
> string historyID = null;
> string devInfo = @."<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
> SessionHeader sh = new SessionHeader();
> rs.SessionHeaderValue = sh;
> results = rs.Render(
> this.ReportConfig.ReportName,
> "PDF",
> historyID,
> devInfo,
> parameters,
> credentials,
> showHideToggle, out encoding, out mimeType, out
> reportHistoryParameters,
> out warnings,
> out streamIDs);
> m_SessionID = rs.SessionHeaderValue.SessionId;
> But when I use the generated sesionid for the URL access like this:
> url => "http://guoxp.softbrandsamer.com/reportserver?%2fInvItmb&rs:Command=Render&r
> s:SessionID=" + m_SessionID
> it will create a new instance. And when I looked at the SessionData table in
> the ReportServerTempDB, a new session is created.
> How to make it work? Please help. Thanks,
> Lianghong
>
>|||Hi
I've the same problem with the session an rs:SessionId, anyone knwo a
solution'
Thanks
"debra doty" wrote:
> Did you ever find a work around for this. It doesn't seem to be working for
> me either.
> "Guo, Lianghong" wrote:
> > I want to render a PDF report and view the copy of the report in the HTML
> > viewer. What I did is to use rs.Render(...) to get the PDF report and the
> > SessionID, and then pass the SessionID to the URL string and run the URL.
> > But the rs:SessionID=xxxxx command does not work, it alway create a new
> > session for the report.
> >
> > This part of the code works fine to generate a PDF file for me and save a
> > session id in m_SessionID:
> >
> > byte[] results = null;
> > string historyID = null;
> > string devInfo = @."<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";
> >
> > SessionHeader sh = new SessionHeader();
> > rs.SessionHeaderValue = sh;
> > results = rs.Render(
> > this.ReportConfig.ReportName,
> > "PDF",
> > historyID,
> > devInfo,
> > parameters,
> > credentials,
> > showHideToggle, out encoding, out mimeType, out
> > reportHistoryParameters,
> > out warnings,
> > out streamIDs);
> > m_SessionID = rs.SessionHeaderValue.SessionId;
> >
> > But when I use the generated sesionid for the URL access like this:
> > url => > "http://guoxp.softbrandsamer.com/reportserver?%2fInvItmb&rs:Command=Render&r
> > s:SessionID=" + m_SessionID
> >
> > it will create a new instance. And when I looked at the SessionData table in
> > the ReportServerTempDB, a new session is created.
> >
> > How to make it work? Please help. Thanks,
> >
> > Lianghong
> >
> >
> >
No comments:
Post a Comment