Page Index Toggle Pages: [1] 2 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Invoices (Read 7734 times)
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Invoices
Jul 19th, 2022 at 4:22am
Print Post  
Hi,
1)How to bind dataTable to a DataRange?
Please refer following file :
https://drive.google.com/file/d/1bMtHVNVGNZTSOlxBtUMQAhncyi4q1d8j/view?usp=shari
ng

2)
Report report = Report.FromDictionary(new Uri("InvoicesReport.xaml", UriKind.Relative), "invoices");
-->Is there anyway to load a xaml from local path (ex. "C:\\data\\InvoicesReport.xaml")?
  

1_002.png ( 29 KB | 91 Downloads )
1_002.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Invoices
Reply #1 - Jul 19th, 2022 at 10:07am
Print Post  
Hi,

1. It seems the [] syntax can bind to DataRowView values but not DataRow ones. E.g. this starts displaying the shipping addresses -

Code
Select All
e.Details = orderTable.DefaultView; 



but I also had to remove the + expressions due to DBNulls not supported there.

2. Our developer will try to add FromFile method later this week.

Regards,
Slavcho
MindFusion
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Invoices
Reply #2 - Jul 19th, 2022 at 1:22pm
Print Post  
Hi,

This build adds Report.FromFile method, and also lets you bind directly to DataRows -
https://mindfusion.eu/_beta/report_fromfile.zip

FromFile relies on WPF's XamlReader class, which does not allow setting Name values inside ResourceDictionary for whatever reason. As a work-around, you can set InternalName instead:

Code
Select All
<ResourceDictionary>
  ...
  <r:Report
    ...
    <r:DataRange r:InternalName="OrdersRange">
 



or otherwise make Report the root element of Xaml file:

Code
Select All
<r:Report ...
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:r="http://mindfusion.eu/reporting/wpf">

    ...
    <r:DataRange Name="OrdersRange">
 



In latter case, FromFile ignores its key parameter and just returns the root report.

Regards,
Slavcho
Mindfusion
« Last Edit: Jul 19th, 2022 at 4:12pm by Slavcho »  
Back to top
 
IP Logged
 
Mandy
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #3 - Jul 25th, 2022 at 9:58am
Print Post  
Hi Slavcho,

1)I'm already add the license, Why the report display 'Trial Version' message ?

2)How to Converter value ?

Thank you.
  

1_003.png ( 50 KB | 87 Downloads )
1_003.png
2_006.png ( 44 KB | 88 Downloads )
2_006.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Invoices
Reply #4 - Jul 25th, 2022 at 11:44am
Print Post  
Hi,

1. This build has an encoded license date from 2021.R2 release of WPF pack. If your one year of maintenance (technical support and upgrades) expired before that, the license key won't work for it and newer versions.

2. Once you add {Binding} directive, it starts using WPF's property binding, which does not work directly with DataRow column names. Try binding by column index as shown here -
https://stackoverflow.com/questions/2831656/how-does-one-bind-to-a-listdatarow-c...

or use DataRowView instead, which supposedly has some support for binding implemented through ICustomTypeDescriptor interface -
https://social.msdn.microsoft.com/Forums/vstudio/en-US/da62c7c9-835c-443e-baaf-f...

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


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #5 - Jul 26th, 2022 at 2:07am
Print Post  
Hi Slavcho,

If I upgrade my old  WPF pack version , what is the price of 2021.R2 WPF pack ?
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Invoices
Reply #6 - Jul 26th, 2022 at 6:06am
Print Post  
Hi Mandy,

Renewal is 60% discount on list price. Better email to sales@mindfusion.eu for details.

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


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #7 - Jul 27th, 2022 at 9:04am
Print Post  
Hi Slavcho,

I have renewed my WPF pack licence.

1)Do I need to download the latest WPF pack? Or use https://mindfusion.eu/_beta/report_fromfile.zip

2)I try to bind a DataView to DataRange's DataSource  , the Converter still show error messages.

  

1_004.png ( 47 KB | 88 Downloads )
1_004.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Invoices
Reply #8 - Jul 27th, 2022 at 10:35am
Print Post  
Hi Mandy,

1. Use the beta build for time being, we'll try to release new official version next week.

2. The square brackets syntax is recognized only by the report I think; try removing the brackets when in {Binding} expression, which is WPF own handler. I.e. try binding to your DataRowView value from another element in the window UI to verify WPF recognizes the syntax, and then it should work in the report template too.

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


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #9 - Jul 28th, 2022 at 8:40am
Print Post  
Hi Slavcho,

I don't know how to make it work.

Do you have any example ?


Thank you.
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Invoices
Reply #10 - Jul 28th, 2022 at 5:13pm
Print Post  
Hi Mandy,

Do you mean using {Binding} inside the report template? Generally these are equivalent if you don't use expressions but just the column name -

Code
Select All
<r:Label Location="14,2" Size="40,4" Text="[ShipName]" />
<r:Label Location="14,2" Size="40,4" Text="{Binding ShipName}" /> 



E.g. using some random value converter I've got from https://stackoverflow.com/questions/13990468/how-to-convert-lower-case-to-upper-case-in-wpf-by-xaml

Code
Select All
<local:ToUpperValueConverter x:Key="ToUpper"/>
...
<r:Label Location="14,2" Size="40,4" Text="{Binding ShipName, Converter={StaticResource ToUpper}}" />
 



runs the converter as expected -



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


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #11 - Mar 29th, 2023 at 12:12pm
Print Post  
Hi,
1) Text="{Binding OrderID}" does not working.
2) The output window of vs2019 will display "BindingExpression path error" when passing value to IValueConvert.
3)The FontSize/FontWeight  in Style does not work, how to set it?

Thanks.

  

20230329.png ( 83 KB | 32 Downloads )
20230329.png
20230329-2.png ( 22 KB | 41 Downloads )
20230329-2.png
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Invoices
Reply #12 - Mar 30th, 2023 at 7:12am
Print Post  
Hi,

All of these work if I just modify the original example -

Code
Select All
<r:Label Location="0%,32" Size="14%,6" Text="{Binding Path=[OrderID]}" Style="{StaticResource ContentLabelStyle}" />
<r:Label Location="14%,32" Size="14%,6" Text="{Binding Path=OrderID}" Style="{StaticResource ContentLabelStyle}" />
<r:Label Location="28%,32" Size="14%,6" Text="{Binding OrderID}" Style="{StaticResource ContentLabelStyle}" />
<r:Label Location="42%,32" Size="14%,6" Text="[OrderID]" Style="{StaticResource ContentLabelStyle}" /> 



Please attach your copy and our developer will check it.

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


I Love MindFusion!

Posts: 47
Joined: Jun 3rd, 2020
Re: Invoices
Reply #13 - Mar 30th, 2023 at 8:08am
Print Post  
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Online


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Invoices
Reply #14 - Apr 3rd, 2023 at 7:43am
Print Post  
Right, {Binding OrderID} is not working for me too with your example. Our developer will investigate.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send TopicPrint