Exception on report.ShowDotMatrixWithWpf();

Stimulsoft Reports.WPF discussion
Post Reply
midhun
Posts: 3
Joined: Sun Nov 19, 2017 5:18 am

Exception on report.ShowDotMatrixWithWpf();

Post by midhun »

at Stimulsoft.Report.Painters.StiPainter.GetPainter(Type type, StiGuiMode guiMode) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Painters\StiPainter.cs:line 88
at Stimulsoft.Report.Painters.StiWpfPainter.MeasureComponent(Double width, StiComponent comp) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Painters\StiWpfPainter.cs:line 42
at Stimulsoft.Report.Components.StiWpfTextRender.MeasureString(Double width, StiText textBox) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Components\StiWpfTextRender.cs:line 61
at Stimulsoft.Report.Components.StiText.GetActualSize() in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Components\SimpleComponents\StiText.cs:line 1568
at Stimulsoft.Report.Components.StiContainerHelper.CheckSize(StiComponent component) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Components\ComplexComponents\StiContainerHelper.cs:line 116
at Stimulsoft.Report.Engine.StiContainerV2Builder.InternalRender(StiComponent masterComp) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\Builders\StiContainerV2Builder.cs:line 262
at Stimulsoft.Report.Components.StiComponent.InternalRender() in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Components\StiComponent.cs:line 1360
at Stimulsoft.Report.Engine.StiEngine.InternalRenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents, Boolean& isChildsEnabled) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\StiEngine.cs:line 2664
at Stimulsoft.Report.Engine.StiEngine.RenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\StiEngine.cs:line 2444
at Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderBand(StiDataBand masterDataBand, StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\Builders\StiDataBandV2Builder.cs:line 1641
at Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderReportTitles(StiDataBand masterDataBand) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\Builders\StiDataBandV2Builder.cs:line 1399
at Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderMaster(StiDataBand masterDataBand) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\Builders\StiDataBandV2Builder.cs:line 1846
at Stimulsoft.Report.Components.StiDataBand.RenderMaster() in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Components\Bands\StiDataBand.cs:line 1752
at Stimulsoft.Report.Engine.StiPageHelper.RenderPage(StiPage page) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\StiPageHelper.cs:line 458
at Stimulsoft.Report.Engine.StiRenderProviderV2.RenderReport(StiReport report, StiReport masterReport, StiRenderState state) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\StiRenderProviderV2.cs:line 1387
at Stimulsoft.Report.Engine.StiRenderProviderV2.Render(StiReport report, StiRenderState state) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\StiRenderProviderV2.cs:line 409
at Stimulsoft.Report.Engine.StiReportV2Builder.RenderSingleReport(StiReport masterReport, StiRenderState renderState) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\Engine\EngineV2\Builders\StiReportV2Builder.cs:line 144
at Stimulsoft.Report.StiReport.RenderReport(StiRenderState renderState) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.Render.cs:line 349
at Stimulsoft.Report.StiReport.Render(StiRenderState renderState, StiGuiMode guiMode) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.Render.cs:line 181
at Stimulsoft.Report.StiReport.ShowDotMatrixWithWpf(Boolean dialogWindow) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.Show.cs:line 924
at Stimulsoft.Report.StiReport.ShowDotMatrixWithWpf() in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.Show.cs:line 912
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: Exception on report.ShowDotMatrixWithWpf();

Post by Edward »

Hi Midhun,

Sorry, could not reproduce that with the latest pre-release version 2017.2.4. The method report.ShowDotMatrixWithWpf() worked just fine there.
Could you please attach the .mrt report file here or, alternatively, send it to support[at]stimulsoft.com

Thank you,
Edward
midhun
Posts: 3
Joined: Sun Nov 19, 2017 5:18 am

Re: Exception on report.ShowDotMatrixWithWpf();

Post by midhun »

We are having a prism MVVM application
XAML Button code
________________

<Button
Name="PrintButton"
Width="80"
Height="40"
Margin="0,10,30,20"
HorizontalAlignment="Right"
Background="{StaticResource PrimaryBackgroundBrush100}"
Command="{Binding PrintMissingPaxCmd}"
Content="{x:Static resources:PaxTabStrings.Print}"
Style="{StaticResource ButtonPrimary}" />

Code in view model

public ICommand PrintMissingPaxCmd { get; set; }
init()
{

this.PrintMissingPaxCmd = new DelegateCommand( () => this.PrintMissingPaxCmdEvent());
}

private void PrintMissingPaxCmdEvent()
{
try
{


this.PrintMissingPassengerList();

}
catch (Exception ex)
{
logger?.LogError(ex.Message, ex);
}
}

protected override void PrintMissingPassengerList()
{
var template= File.ReadAllText(@"C:\ApiLogs\SimpleList.mrt");
StiReport report=new StiReport();
report.LoadFromString(template);
report.ShowDotMatrixWithWpf();
}
Attachments
SimpleList.mrt
(35.83 KiB) Downloaded 320 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Exception on report.ShowDotMatrixWithWpf();

Post by HighAley »

Hello.

If you are trying to load this report template you should register data.
There is no data connection in this report template.

Thank you.
midhun
Posts: 3
Joined: Sun Nov 19, 2017 5:18 am

Re: Exception on report.ShowDotMatrixWithWpf();

Post by midhun »

No difference :(
Attaching my sample POC also attached here with. Only difference from the samples in git it that I created a separate printcontrl project and referencing it to my main project.
Attachments
StimulSoftPOC.zip
Sample POC with stimulsoft controls
(4.38 MiB) Downloaded 232 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Exception on report.ShowDotMatrixWithWpf();

Post by HighAley »

Hello.

There is an issue with loading our assemblies.
Please, try to call any static method from this assembly.
You could try this code:

Code: Select all

public void Show()
        {
            var attr = new Stimulsoft.Report.Wpf.StiWpfToolboxBrowsableAttribute();

            var template = File.ReadAllText(@"..\..\Template\template.json");
            StiReport report = new StiReport();
            report.LoadFromJson(template);
            DataSet dataSet1 = new DataSet();
            dataSet1.ReadXmlSchema(@"..\..\Data\Demo.xsd");
            dataSet1.ReadXml(@"..\..\Data\Demo.xml");
            report.RegData(dataSet1);
            report.ShowDotMatrixWithWpf();

        }
Thank you.
Post Reply