URL Parameters Value
Re: URL Parameters Value
Thanks again
I am trying to use the followinng code, but its not being passed through the the dashboard from server/dashboard/Default.aspx?vOrgID=something
protected void StiWebViewer1_GetReport(object sender, StiReportDataEventArgs e)
{
var report = StiReport.CreateNewDashboard();
var path = Server.MapPath("Reports/Report.mrt");
report.Load(path);
report.Dictionary.Variables["vOrgID"].ValueObject = Request.QueryString["vOrgID"];
e.Report = report;
}
The vOrgID variable is set as below
I am trying to use the followinng code, but its not being passed through the the dashboard from server/dashboard/Default.aspx?vOrgID=something
protected void StiWebViewer1_GetReport(object sender, StiReportDataEventArgs e)
{
var report = StiReport.CreateNewDashboard();
var path = Server.MapPath("Reports/Report.mrt");
report.Load(path);
report.Dictionary.Variables["vOrgID"].ValueObject = Request.QueryString["vOrgID"];
e.Report = report;
}
The vOrgID variable is set as below
Re: URL Parameters Value
Narrowing this down, hard-coding the variable like
report.Dictionary.Variables["vOrgID"].ValueObject = "moo"
also does not work
Oddly....I can trash the default.aspx.cs by filling it nonsense and the dashboard still loads?
report.Dictionary.Variables["vOrgID"].ValueObject = "moo"
also does not work
Oddly....I can trash the default.aspx.cs by filling it nonsense and the dashboard still loads?
Re: URL Parameters Value
This is what I am working with if anyone can advise please?
Default.aspx
Default.aspx.cs
No matter what, the vOrgID does not change on the dashboard?
Default.aspx
Code: Select all
<%@ Page Title="Report.mrt - Viewer" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication._Default" %>
<%@ Register assembly="Stimulsoft.Report.Web, Version=2022.2.5.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a" namespace="Stimulsoft.Report.Web" tagprefix="cc1" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<cc1:StiWebViewer ID="StiWebViewer1" runat="server"
OnGetReport="StiWebViewer1_GetReport">
</cc1:StiWebViewer>
</asp:Content>
Code: Select all
using Stimulsoft.Report;
using Stimulsoft.Report.Dictionary;
using Stimulsoft.Report.Web;
using System;
using System.Data;
using System.IO;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication
{
public partial class _Default : Page
{
static _Default()
{
Stimulsoft.Base.StiLicense.Key =
"removed";
}
protected void Page_Load(object sender, EventArgs e)
{
StiReport report = new StiReport();
report.Load(Server.MapPath("Reports/Report.mrt"));
StiWebViewer1.Report = report;
}
protected void StiWebViewer1_GetReport(object sender, StiReportDataEventArgs e)
{
StiReport report = new StiReport();
report.Load(Server.MapPath("Reports/Report.mrt"));
report.Dictionary.Variables["vOrgID"].Value = "something";
e.Report = report;
}
}
}
-
- Posts: 6244
- Joined: Tue Mar 20, 2018 5:34 am
Re: URL Parameters Value
Hello,
Do you check the provided sample?
Thank you.
Do you check the provided sample?
Thank you.
- Attachments
-
- Screenshot 2022-06-01 225422.png (76.92 KiB) Viewed 1202 times
Re: URL Parameters Value
Yes, I even tried simply changing the variable directly in the code
report.Dictionary.Variables["vOrgID"].ValueObject = "moo"
Have I set something up incorrectly on the variable in the mrt?
report.Dictionary.Variables["vOrgID"].ValueObject = "moo"
Have I set something up incorrectly on the variable in the mrt?
Re: URL Parameters Value
Could the issue be IIS related?
Replacing the variable to request from user works
report.Dictionary.Variables["vOrgID"].RequestFromUser = true;
Replacing the variable to request from user works
report.Dictionary.Variables["vOrgID"].RequestFromUser = true;
-
- Posts: 6244
- Joined: Tue Mar 20, 2018 5:34 am
Re: URL Parameters Value
Hello,
Please send us your project that reproduces the issue for analysis.
Thank you.
Please send us your project that reproduces the issue for analysis.
Thank you.
Re: URL Parameters Value
Sorry for the late reply. Do you want the files attached here or send directly in PM?
-
- Posts: 6244
- Joined: Tue Mar 20, 2018 5:34 am
Re: URL Parameters Value
Thanks again.
Here is the application
Here is the application