Page Index Toggle Pages: 1 [2] 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Invoices (Read 8117 times)
Slavcho
God Member
*****
Offline


tech.support

Posts: 3194
Joined: Oct 19th, 2005
Re: Invoices
Reply #15 - Apr 3rd, 2023 at 5:47pm
Print Post  
That looks to be another difference between FromFile/Stream vs FromDictionary implementations. Probably XamlLoader used in former is not preparing the loaded content for binding and styling out of the box when non-WPF types are involved. Our developer will research the differences.

It seems you've reverted to loading the report back from embedded resource anyway? so you could as well load it using FromDictionary method as in original example.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #16 - Apr 7th, 2023 at 7:43am
Print Post  
Hi Slavcho,
1)The report will be dynamically loaded from an external source, so "FromStream" will be used to implement it.

2)When passing a value to "IValueConvert", the output window in VS2019 displays "BindingExpression path error".
This will slow down the execution speed of the report. Is there a way to resolve this issue?

3)The "FontSize/FontWeight" property in the "Style" is not working. How can it be set?
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3194
Joined: Oct 19th, 2005
Re: Invoices
Reply #17 - Apr 7th, 2023 at 8:33am
Print Post  
Hi Mandy,

2&3 work with FromDictionary version, so you might look for a way to get FromFictionary(url) load external files URLs; our developers could not when they looked into that last time though.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #18 - Apr 7th, 2023 at 11:32am
Print Post  
Hi Slavcho,
1)Can a URL be passed directly to "FromDictionary"?
For example: Report.FromDictionary("https://test.com/InvoicesReport1.xaml")

2)The file may be downloaded from the Internet and saved locally, can a path be specified?
For example:  Report.FromDictionary("C:/users/mandy/Downloads/InvoicesReport1.xaml")

  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3194
Joined: Oct 19th, 2005
Re: Invoices
Reply #19 - Apr 7th, 2023 at 2:27pm
Print Post  
Hi Mandy,

FromDictionary is just a 'return Application.LoadComponent(uri) as Report':

https://learn.microsoft.com/en-us/dotnet/api/system.windows.application.loadcomp...

We could not find a way to load external file through that last time and implemented FromFile using XamlLoader, which apparently has some problems with binding expressions. Our developer will check these again in a few days.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3194
Joined: Oct 19th, 2005
Re: Invoices
Reply #20 - Apr 7th, 2023 at 2:33pm
Print Post  
LoadComponent(uri) above links to this topic -

https://learn.microsoft.com/en-us/dotnet/desktop/wpf/app-development/wpf-applica...

so you might be able to make FromDictionary work by declaring a placeholder xaml file as Content file, overwrite it with the external file when you need to load report from one, and than call FromDictionary(content_placeholder_uri).

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3194
Joined: Oct 19th, 2005
Re: Invoices
Reply #21 - Apr 10th, 2023 at 4:05pm
Print Post  
Text="{Binding OrderID}" works if you also set DataSource="{Binding Orders}" on the DataRange element; it was commented out. The converter then works too -

Code
Select All
Text="{Binding Path=OrderDate, Converter={StaticResource MyDateFormatConverter}, ConverterParameter='yyyy-MM-dd'}" 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #22 - Apr 18th, 2023 at 8:37am
Print Post  
Hi Slavcho,

1)Is it possible to download XAML from the internet and load it into a report besides Content file and LoadComponent?


2)「so you might be able to make FromDictionary work by declaring a placeholder xaml file as Content file, overwrite it with the external file when you need to load report from one, and than call FromDictionary(content_placeholder_uri).」=>Do you have any example that I can refer to?


Regards.
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3194
Joined: Oct 19th, 2005
Re: Invoices
Reply #23 - Apr 18th, 2023 at 10:43am
Print Post  
Hi Mandy,

Forget about placeholder, just return back the DataSource="{Binding Orders}" for parent DataRange as in original example. It works for us with external files too then.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #24 - Apr 19th, 2023 at 3:24am
Print Post  
Hi Slavcho,

I am trying to load a report using two methods: FromDictionary and FromStream.

Here is my project:
https://drive.google.com/file/d/1R4peE9AowoJ5mdFFACr91gMc6X9QkpxJ/view?usp=shari
ng


"BindingExpression path error". => This will slow down the execution speed of the report.

3)The "FontSize/FontWeight" property in the "Style" is not working.

Both of these methods will display an error message as shown in the following image

  

20230419.png ( 72 KB | 43 Downloads )
20230419.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3194
Joined: Oct 19th, 2005
Re: Invoices
Reply #25 - Apr 20th, 2023 at 3:16pm
Print Post  
Hi Mandy,

Path error is WPF thing and nothing to do with the report. {Binding PropertyName} works if the data object actually has such property, so you could create strongly-typed models for your data rows if you need to use exactly that syntax. Otherwise DataRow itself does not expose the columns as properties, and you must use [] indexers to access them -

https://stackoverflow.com/questions/4174906/how-do-you-bind-a-datarow-to-a-textb...

e.g. Binding Path=[ShippedDate] ...

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3194
Joined: Oct 19th, 2005
Re: Invoices
Reply #26 - Apr 20th, 2023 at 4:08pm
Print Post  
Hi Mandy,

Try this build for font styles -
https://mindfusion.eu/_temp/label_style.zip

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #27 - May 2nd, 2023 at 11:35am
Print Post  
Hi Slavcho,
1)The font style works, Thank you.
2)Is there any way to bypass path errors other than creating strongly-typed models?

Regards,
Mandy
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3194
Joined: Oct 19th, 2005
Re: Invoices
Reply #28 - May 3rd, 2023 at 5:07am
Print Post  
Hi Mandy,

Warnings are displayed by XamlReader.Load /  ItemTemplate.LoadContent methods before the report has the chance to apply data context to loaded elements. If {Binding} messages bother you that much, use the original Text="[OrderID]" syntax we show in sample projects.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #29 - Jul 5th, 2023 at 3:03am
Print Post  
Hi Slavcho,
Is there any way to keep the DataRange.HeaderTemplate displayed even if the data is empty?

Regards,
Mandy
  

rpt1.png ( 31 KB | 34 Downloads )
rpt1.png
rpt2.png ( 31 KB | 32 Downloads )
rpt2.png
rpt3.png ( 29 KB | 36 Downloads )
rpt3.png
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send TopicPrint