Problems with Designer (the installed executable)

Stimulsoft Reports.WEB discussion
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problems with Designer (the installed executable)

Post by HighAley »

Hello.
kgb2013 wrote:As far as I see, the preview on the Designer.exe is correct, but in my site it's not correct.
Did you try it with the MVC viewer on a simple web site?
(I have re-checked this in one of your demo projects)
Could you describe this issue more detailed with samples?
kgb2013 wrote:I also attach a video for you.
Sorry but we couldn't reproduce this issue.
How do you run Designer.exe?
Could you send us your report template?
Does Save as... command work?

Thank you.
kgb2013
Posts: 85
Joined: Fri Nov 01, 2013 9:52 am
Location: Earth

Re: Problems with Designer (the installed executable)

Post by kgb2013 »

I attach a test file (Test.mrt).
It has a German Culture set to it and a {Time} field displayed.
I load this with this code:

Code: Select all

@section JS{
	@Html.Stimulsoft().RenderMvcViewerScripts()
}
			@Html.Stimulsoft().StiMvcViewer(
			"Reports",
			new StiMvcViewerOptions()
				{
					Controller = "List",
					ActionGetReportSnapshot = "GetReportSnapshot?r=" + r,
					ActionViewerEvent = "ViewerEvent?r=" + r,
					ActionExportReport = "ExportReport?r=" + r,
					ActionPrintReport = "PrintReport?r=" + r,
					//ServerCacheMode = StiCacheMode.Page,
					Width = Unit.Percentage(100),
					Height = Unit.Pixel(1300),
					ClientRequestTimeout = 900000,
					Theme = StiTheme.Office2007Silver,
					ScrollbarsMode = true,

					//CountColumnsParameters = 4,
					ShowButtonParameters = true,

					BackColor = Color.DarkGray,
					MenuShowMode = StiShowMenuMode.Click,
					MenuViewMode = StiWebViewMode.OnePage,
					MenuAnimation = false,
					ShowButtonBookmarks = false,
			
					//ActionDesignReport = "",
					//ShowButtonDesign = true,
				}
			 )

		public ActionResult GetReportSnapshot(ListModel model)
		{
			using(var report = GetReport(model))
			{
				return StiMvcViewer.GetReportSnapshotResult(HttpContext, report);
			}
		}

		public ActionResult ViewerEvent(ListModel model)
		{
			using (var report = GetReport(model))
			{
				return StiMvcViewer.ViewerEventResult(HttpContext, report);
			}
		}
		private StiReport GetReport(ListModel model)
		{
			var r = HttpContext.Request.QueryString["r"];
			if (string.IsNullOrWhiteSpace(r))
			{
				var docs = model.GetDocsStimulSoft();
				var newDocs = docs.Select(x => new
							{
								// Fill in the properties...
							});
				var report = new StiReport();
				report.Load(MrtFilePath);
				report.RegBusinessObject("Document", "Document", newDocs.ToList());
				return report;
			}
			else
			{
				string mrtFile = HttpUtility.UrlDecode(r, Encoding.UTF8);
				mrtFile = Path.Combine(ReportsDir, mrtFile + ".mrt");
				var report = new StiReport();
				report.Load(mrtFile);
				SetReportParameters(report);
				return report;
			}
		}

		void SetReportParameters(StiReport report)
		{
			ChangeConenctionString(report);
			report.RequestParameters = true;
			var vars = report.Dictionary.Variables;
			var ident = IoC.GetInstance<IIdentityContext>();
			report["usrID"] = ident.UserId;
			report["grpID"] = ident.CurrentGroupId;
			report["FromDate"] = DateTime.Now.AddYears(-1);
			report["ToDate"] = DateTime.Now;
		}

		void ChangeConenctionString(StiReport report)
		{
			report.Dictionary.Databases.Clear();
			report.Dictionary.Databases.Add(new StiSqlDatabase("Connection", "Connection", "connection string", false));
		}
My Windows is in English but the default thread culture is Greek (I guess this is due to "Region and Language" settings).
When I view the report with the code presented above, I see the {Time} field in Greek (21/11/2013 10:10:12 πμ).

-------------------------------

Nope. "Save As" doesn't help either.
I attach my MRT file (SOS_Report 4.mrt).
Attachments
Test.mrt
(3.79 KiB) Downloaded 371 times
SOS_Report 4.mrt
(35.58 KiB) Downloaded 306 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problems with Designer (the installed executable)

Post by HighAley »

Hello.

The culture of the thread overrides the Culture property of the report.
So there is always Greek culture in your report.

Thank you.
kgb2013
Posts: 85
Joined: Fri Nov 01, 2013 9:52 am
Location: Earth

Re: Problems with Designer (the installed executable)

Post by kgb2013 »

Hello.

But then what's the point in having a Culture in the MRT?
The current thread always has a culture.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problems with Designer (the installed executable)

Post by HighAley »

Hello.

Please, send us a sample working project which reproduces this issue for analysis.

Thank you.
kgb2013
Posts: 85
Joined: Fri Nov 01, 2013 9:52 am
Location: Earth

Re: Problems with Designer (the installed executable)

Post by kgb2013 »

I have made a demo project, but I have no such problem in there. :(
I can't understand what is the difference in my real project yet. :(
Last edited by kgb2013 on Wed Nov 27, 2013 2:55 pm, edited 1 time in total.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Problems with Designer (the installed executable)

Post by Alex K. »

Hello,

It is difficult to say something without the sample which reproduce the issue.

Thank you.
kgb2013
Posts: 85
Joined: Fri Nov 01, 2013 9:52 am
Location: Earth

Re: Problems with Designer (the installed executable)

Post by kgb2013 »

Concerning the font size problem that I described previously, it seems that only happens for some MRT.
I attach one that has the problem.
Try to change the font size of the green area (ReportTitleBand), save the report and then reload it with the Designer.exe.
When I reload it, the font size is restored to the old one.

Also, saving the borders for the same ReportTiltleBand has the same problem.
I hope this helps you locate the problem. :)
Attachments
abc.mrt
(38.06 KiB) Downloaded 373 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Problems with Designer (the installed executable)

Post by Alex K. »

Hello,

Please try to check the ComponentStyle property for this component.

Thank you.
kgb2013
Posts: 85
Joined: Fri Nov 01, 2013 9:52 am
Location: Earth

Re: Problems with Designer (the installed executable)

Post by kgb2013 »

Aha!
Setting ComponentStyle to None solves it.
Great!
Thanks. :)
Post Reply