or
Telerik.Reporting.Processing.ReportProcessor TelContractrp =
new
Telerik.Reporting.Processing.ReportProcessor();
System.Collections.Hashtable deviceInfo =
new
System.Collections.Hashtable();
Telerik.Reporting.InstanceReportSource TelContractirs =
new
Telerik.Reporting.InstanceReportSource();
TelContractirs.ReportDocument = currRpt;
Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport(
"DOCX"
, TelContractirs, deviceInfo);
string
dContract = DateTime.Now.ToString().Replace(
"/"
,
""
);
dContract = dContract.Substring(0, 12);
dContract = dContract.Replace(
":"
,
""
);
string
fileName2 = result.DocumentName +
"_"
+ dContract +
"."
+ result.Extension;
string
filePath2 = System.IO.Path.Combine(saveLocation, fileName2);
FileStream fs =
new
FileStream(filePath2, FileMode.Create);
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
fs.Close();
System.Diagnostics.Process p =
new
System.Diagnostics.Process();
p.StartInfo.UseShellExecute =
true
;
p.StartInfo.FileName = filePath2;
p.Start();
<
tkr:ReportViewer
ReportServerUri
=
"../ReportingService.svc"
Report
=
"param1=X;param2=Y;etc"
/>
public
class
MyReportingService : ReportService, IReportResolver
{
public
MyReportingService ()
{
this
.ReportResolver =
this
;
}
ReportSource IReportResolver.Resolve(
string
report )
{
var myReport =
new
MyReport();
// Here I customize the "myReport" instance based on the
// value of the "report" parameter
return
new
InstanceReportSource() { ReportDocument = myReport };
}
}
public
ActionResult test() {
var instanceReportSource =
new
Telerik.Reporting.InstanceReportSource();
instanceReportSource.ReportDocument =
new
myReport();
ReportViewer report =
new
ReportViewer();
report.ID =
"Teste"
;
report.Width = 100;
report.ReportSource = instanceReportSource;
return
??
}
Protected
Sub
Page_Load(sender
As
Object
, e
As
System.EventArgs)
Handles
Me
.Load
'If Not IsPostBack Then
Dim
report1
As
New
PMP2Reports.DocumentsReviewed
Dim
objSession
As
Object
objSession = Session(
"subIdx"
)
If
Not
objSession
Is
Nothing
Then
report1.ReportParameters(
"subIdx"
).Value = objSession
End
If
ReportViewer1.Report = report1
ReportViewer1.RefreshReport()
' End If
End
Sub