Page 2 of 3

Re: URL Parameters Value

Posted: Wed Jun 01, 2022 11:56 am
by MLirko
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
vOrgID_img.png
vOrgID_img.png (8.07 KiB) Viewed 2893 times

Re: URL Parameters Value

Posted: Wed Jun 01, 2022 1:54 pm
by MLirko
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?

Re: URL Parameters Value

Posted: Wed Jun 01, 2022 4:01 pm
by MLirko
This is what I am working with if anyone can advise please?

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>
Default.aspx.cs

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;

		}
	}
}
No matter what, the vOrgID does not change on the dashboard?

Re: URL Parameters Value

Posted: Wed Jun 01, 2022 8:55 pm
by Lech Kulikowski
Hello,

Do you check the provided sample?

Thank you.

Re: URL Parameters Value

Posted: Thu Jun 02, 2022 7:41 am
by MLirko
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?

Re: URL Parameters Value

Posted: Thu Jun 02, 2022 7:53 am
by MLirko
Could the issue be IIS related?

Replacing the variable to request from user works
report.Dictionary.Variables["vOrgID"].RequestFromUser = true;

Re: URL Parameters Value

Posted: Thu Jun 02, 2022 10:00 am
by Lech Kulikowski
Hello,

Please send us your project that reproduces the issue for analysis.

Thank you.

Re: URL Parameters Value

Posted: Wed Jun 08, 2022 3:49 pm
by MLirko
Sorry for the late reply. Do you want the files attached here or send directly in PM?

Re: URL Parameters Value

Posted: Wed Jun 08, 2022 7:01 pm
by Lech Kulikowski
Hello,

You can attach it in the post or send it on support@stimulsoft.com

Thank you.

Re: URL Parameters Value

Posted: Thu Jun 09, 2022 7:47 am
by MLirko
Thanks again.

Here is the application
WebApplication.zip
(24.33 MiB) Downloaded 362 times