Code Monkey home page Code Monkey logo

Comments (7)

hakancunier avatar hakancunier commented on May 18, 2024 1

Try to set up default value of the query parameter and add reference to a report parameter.
image

Unfortunately doesnt worked. throws "input string was not in a correct format"
Here is my xml :
<Report ScriptLanguage="CSharp" ReportInfo.Created="07/25/2019 00:35:52" ReportInfo.Modified="07/25/2019 00:40:34" ReportInfo.CreatorVersion="2019.3.0.0"> <Dictionary> <PostgresDataConnection Name="Connection" ConnectionString="my con"> <TableDataSource Name="Table" DataType="System.Int32" Enabled="true" SelectCommand="select * from public.&quot;s_kullanici&quot; where &quot;s_kullanici&quot;.&quot;id&quot;=@prm"> <CommandParameter Name="prm" DataType="1"/> </TableDataSource> </PostgresDataConnection> </Dictionary> <ReportPage Name="Page1" Watermark.Font="Arial, 60pt"> <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8"/> <PageHeaderBand Name="PageHeader1" Top="40.47" Width="718.2" Height="28.35"/> <DataBand Name="Data1" Top="71.48" Width="718.2" Height="75.6"/> <PageFooterBand Name="PageFooter1" Top="149.75" Width="718.2" Height="18.9"/> </ReportPage> </Report>

Yes it works.

from fastreport.

8VAid8 avatar 8VAid8 commented on May 18, 2024

Hello!
I've checked parameters in Npgsql connection. You should use it like here:

select * from public."Users" where "Users"."Name"= @Name

And create parameter next.

The full example:

<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="07/22/2019 17:15:27" ReportInfo.Modified="07/22/2019 17:34:34" ReportInfo.CreatorVersion="2019.3.0.0">
  <Dictionary>
    <PostgresDataConnection Name="Connection" ConnectionString="your con">
      <TableDataSource Name="public_Users" DataType="System.Int32" Enabled="true" TableName="public.&quot;Users&quot;">
        <Column Name="id" DataType="System.Int32"/>
        <Column Name="Name" DataType="System.String"/>
      </TableDataSource>
      <TableDataSource Name="Table" DataType="System.Int32" Enabled="true" SelectCommand="select * from public.&quot;Users&quot; where &quot;Users&quot;.&quot;Name&quot;= @Name">
        <Column Name="id" DataType="System.Int32"/>
        <Column Name="Name" DataType="System.String"/>
        <CommandParameter Name="Name" DataType="19" Expression="[Name]" DefaultValue="Ivan"/>
      </TableDataSource>
    </PostgresDataConnection>
    <Parameter Name="Name" DataType="System.String" Expression="&quot;Ivan&quot;"/>
  </Dictionary>
  <ReportPage Name="Page1" Watermark.Font="Arial, 60pt">
    <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8"/>
    <PageHeaderBand Name="PageHeader1" Top="41.8" Width="718.2" Height="28.35">
      <TextObject Name="Text2" Left="85.05" Width="94.5" Height="18.9" Text="id" Font="Arial, 10pt"/>
      <TextObject Name="Text4" Left="283.5" Width="94.5" Height="18.9" Text="Name" Font="Arial, 10pt"/>
    </PageHeaderBand>
    <DataBand Name="Data1" Top="74.15" Width="718.2" Height="75.6" DataSource="Table">
      <TextObject Name="Text1" Left="85.05" Top="28.35" Width="94.5" Height="18.9" Text="[Table.id]" Font="Arial, 10pt"/>
      <TextObject Name="Text3" Left="283.5" Top="28.35" Width="94.5" Height="18.9" Text="[Table.Name]" Font="Arial, 10pt"/>
    </DataBand>
    <PageFooterBand Name="PageFooter1" Top="153.75" Width="718.2" Height="18.9"/>
  </ReportPage>
</Report>

from fastreport.

hakancunier avatar hakancunier commented on May 18, 2024

Unfortunately doesnt worked. throws "input string was not in a correct format"

Here is my xml :
<Report ScriptLanguage="CSharp" ReportInfo.Created="07/25/2019 00:35:52" ReportInfo.Modified="07/25/2019 00:40:34" ReportInfo.CreatorVersion="2019.3.0.0"> <Dictionary> <PostgresDataConnection Name="Connection" ConnectionString="my con"> <TableDataSource Name="Table" DataType="System.Int32" Enabled="true" SelectCommand="select * from public.&quot;s_kullanici&quot; where &quot;s_kullanici&quot;.&quot;id&quot;=@prm"> <CommandParameter Name="prm" DataType="1"/> </TableDataSource> </PostgresDataConnection> </Dictionary> <ReportPage Name="Page1" Watermark.Font="Arial, 60pt"> <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8"/> <PageHeaderBand Name="PageHeader1" Top="40.47" Width="718.2" Height="28.35"/> <DataBand Name="Data1" Top="71.48" Width="718.2" Height="75.6"/> <PageFooterBand Name="PageFooter1" Top="149.75" Width="718.2" Height="18.9"/> </ReportPage> </Report>

from fastreport.

hakancunier avatar hakancunier commented on May 18, 2024

Using integer or bigint parameter datatype causes this problem. In my case the id field is mapped to a long property. If i select text as parameter datatype exception says id is bigint. If i select bigint throws "input string was not in a correct format"

from fastreport.

mehmetalageyik avatar mehmetalageyik commented on May 18, 2024

Same issue here

from fastreport.

8VAid8 avatar 8VAid8 commented on May 18, 2024

Try to set up default value of the query parameter and add reference to a report parameter.
image

Unfortunately doesnt worked. throws "input string was not in a correct format"

Here is my xml :
<Report ScriptLanguage="CSharp" ReportInfo.Created="07/25/2019 00:35:52" ReportInfo.Modified="07/25/2019 00:40:34" ReportInfo.CreatorVersion="2019.3.0.0"> <Dictionary> <PostgresDataConnection Name="Connection" ConnectionString="my con"> <TableDataSource Name="Table" DataType="System.Int32" Enabled="true" SelectCommand="select * from public.&quot;s_kullanici&quot; where &quot;s_kullanici&quot;.&quot;id&quot;=@prm"> <CommandParameter Name="prm" DataType="1"/> </TableDataSource> </PostgresDataConnection> </Dictionary> <ReportPage Name="Page1" Watermark.Font="Arial, 60pt"> <ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8"/> <PageHeaderBand Name="PageHeader1" Top="40.47" Width="718.2" Height="28.35"/> <DataBand Name="Data1" Top="71.48" Width="718.2" Height="75.6"/> <PageFooterBand Name="PageFooter1" Top="149.75" Width="718.2" Height="18.9"/> </ReportPage> </Report>

from fastreport.

8VAid8 avatar 8VAid8 commented on May 18, 2024

Same issue here

Try the same solution, please

from fastreport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.