|
Rank: Newbie Groups: Member
Joined: 12/12/2007 Posts: 6
|
Please help me I need to ouput in grid some datas Float from Dataset populating. But I see that they are only Trims or are not nice Formatted. I need for output float value in TextBoxColumn "PROVA" float data like this formatting ("1234.1234" or "0.0000") but it show me only trim number like 1234 without "." or "," and decimals after. I fill Grid1 by DataSet (I test it and it's same with dataReader)
Code: Visual Basic.NET
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Definisce la stringa sql da apportare alla selezione del Datareader
Dim sql As String = "SELECT SALES_DATA.SALE_ID, CUSTOMERS.RAGSOC1 AS CLIENTE, SALES_DATA.V_IST AS PROVA FROM SALES_DATA LEFT OUTER JOIN CUSTOMERS ON SALES_DATA.CUSTOMER_ID = CUSTOMERS.CUSTOMER_ID"
Dim objConn As New OleDbConnection("Provider=SQLOLEDB.1;Persist Security Info=False;Data Source=/ip/Initial Catalog=MIS2007;User ID=/id/;Password=/pass/;")
Dim strSQL As String = sql
Dim da As New OleDbDataAdapter(strSQL, objConn)
Dim ds = New DataSet()
da.Fill(ds)
Grid1.DataSource = ds
Grid1.DataBind()
End Sub 'Page_Load
If I run debug I can see Grid only with float datas Trimmed in Integer number without decimals
Code: HTML/ASPX
<form id="form1" runat="server">
<eo:CallbackPanel ID="CallbackPanel1" runat="server" AutoDisableContents="True" Height="230px"
SafeGuardUpdate="False" Triggers="{ControlID:Button1;Parameter:}" Width="100%">
<eo:Grid
style="background-color: #ffffff"
ID="Grid1"
runat="server"
AllowColumnReorder="True"
ColumnHeaderAscImage="00050104"
ColumnHeaderDescImage="00050105"
ColumnHeaderDividerImage="00050103"
FixedColumnCount="1" Font-Bold="False" Font-Italic="False"
Font-Names="Tahoma" Font-Overline="False" Font-Size="9pt" Font-Strikeout="False"
Font-Underline="False" FullRowMode="False" GoToBoxVisible="True"
GridLineColor="220, 223, 228"
GridLines="Both" Height="180px" IsCallbackByMe="False" KeyField="SALE_ID"
Width="100%"
RunningMode="Server">
<FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
<ColumnHeaderStyle CssText="background-image:url('00050101');padding-left:8px;padding-top:3px;" />
<ColumnTemplates>
<eo:TextBoxColumn Width="300">
<TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
</eo:TextBoxColumn>
</ColumnTemplates>
<ItemStyles>
<eo:GridItemStyleSet>
<CellStyle CssText="padding-left:8px;padding-top:2px;" />
<FixedColumnCellStyle CssText="border-right: #d6d2c2 1px solid; padding-right: 10px; border-top: #faf9f4 1px solid; border-left: #faf9f4 1px solid; border-bottom: #d6d2c2 1px solid; background-color: #ebeadb; text-align: right" />
</eo:GridItemStyleSet>
</ItemStyles>
<Columns>
<eo:RowNumberColumn>
</eo:RowNumberColumn>
<eo:TextBoxColumn DataField="CLIENTE" HeaderText="CLIENTE" Width="300">
</eo:TextBoxColumn>
<eo:TextBoxColumn DataField="PROVA" DataFormat="{0:0.00}" HeaderText="PROVA" >
</eo:TextBoxColumn>
</Columns>
<GoToBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; BORDER-TOP: #7f9db9 1px solid; BORDER-LEFT: #7f9db9 1px solid; WIDTH: 40px; BORDER-BOTTOM: #7f9db9 1px solid" />
</eo:Grid>
<div id="dettagli" style="overflow:auto; height:75px; visibility:visible;">
<asp:Panel ID="panChanges" runat="server" Visible="False" Width="400px" />
</div>
<asp:Button ID="Button1" runat="server" Text="Post Back!" />
</eo:CallbackPanel>
</form>
Please, I realy need a quick help for this difficult problem.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You can not use DataFormat="{0:0.00}". Try use "{0:N2}", where "2" is the precision. You can find more details here: http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx Thanks
|
|
Rank: Newbie Groups: Member
Joined: 12/12/2007 Posts: 6
|
Sorry but It's not Working. I try change in "{0:N2}" , "{0:N2}" , "{0:D}" but it's same result.
The field "PROVA" comes from MSSQL Server 2005 in money format. I need that grid output show me format Float like "123.1234"
I try in Microsoft site and i didn't find nothing about.
Please, there are other solutions?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
What version are you running? If you want to it to be "xxx.12", you would use {0:N2}, if you want it to be "xxx.1234", you would do {0:N4}. What does the Grid show?
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 12/12/2007 Posts: 6
|
Hi, I use EO.WEB Controls Suite 2007.2 with ASP.NET 2.0. For editing I use Microsoft Visual Web Developer 2005 Express Edition. I was try {0:N4} like u advise before, but nothing happened with Grid. I send u this picture captured: http://ugrid.dd-dyns.com/pubb/testfloat.jpgThis is the output of grid. I need that PROVA's values fields are 1800,1234 or 1256,1234. Why Values are trimed? Thanks for patience
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Regardless what value is in your data source, once you set DataFormat to {0:N2}, you should see a value like xxx.xx, for example, if your data is 1800, you would see 1800.00. So I do not know why it's displaying "1800" for you. You can first check the version of your DLL and upgrade to the latest one (5.0.16.x) if you have not already done so. If the problem persist after that, please post the Url of the page and we will take a look.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 12/12/2007 Posts: 6
|
Now I trying DLL ver 5.0.12.2 in Tryal version. After resolve this problem, I will purcase all Suite Controls. This is my DataSource generated with SQL String: And This is Results in Grid with {0:N4} : Code Behind:
Code: Visual Basic.NET
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Definisce la stringa sql da apportare alla selezione del Datareader
Dim sql As String = "SELECT SALES_DATA.SALE_ID, CUSTOMERS.RAGSOC1 AS CLIENTE, SALES_DATA.V_IST AS PROVA FROM SALES_DATA LEFT OUTER JOIN CUSTOMERS ON SALES_DATA.CUSTOMER_ID = CUSTOMERS.CUSTOMER_ID"
Dim objConn As New OleDbConnection("Provider=SQLOLEDB.1;Persist Security Info=False;Data Source=/ip/;Initial Catalog=MIS2007;User ID=/id/;Password=/pass/;")
Dim strSQL As String = sql
Dim da As New OleDbDataAdapter(strSQL, objConn)
Dim ds = New DataSet()
da.Fill(ds)
Grid1.DataSource = ds
Grid1.DataBind()
End Sub 'Page_Load
Code: HTML/ASPX
<eo:CallbackPanel ID="CallbackPanel1" runat="server" AutoDisableContents="True" Height="230px"
SafeGuardUpdate="False" Triggers="{ControlID:Button1;Parameter:}" Width="100%">
<eo:Grid
style="background-color: #ffffff"
ID="Grid1"
runat="server"
AllowColumnReorder="True"
ColumnHeaderAscImage="00050104"
ColumnHeaderDescImage="00050105"
ColumnHeaderDividerImage="00050103"
FixedColumnCount="1" Font-Bold="False" Font-Italic="False"
Font-Names="Tahoma" Font-Overline="False" Font-Size="9pt" Font-Strikeout="False"
Font-Underline="False" FullRowMode="False" GoToBoxVisible="True"
GridLineColor="220, 223, 228"
GridLines="Both" Height="180px" IsCallbackByMe="False" KeyField="SALE_ID"
Width="100%"
RunningMode="Server">
<FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
<ColumnHeaderStyle CssText="background-image:url('00050101');padding-left:8px;padding-top:3px;" />
<ColumnTemplates>
<eo:TextBoxColumn Width="300">
<TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
</eo:TextBoxColumn>
</ColumnTemplates>
<ItemStyles>
<eo:GridItemStyleSet>
<CellStyle CssText="padding-left:8px;padding-top:2px;" />
<FixedColumnCellStyle CssText="border-right: #d6d2c2 1px solid; padding-right: 10px; border-top: #faf9f4 1px solid; border-left: #faf9f4 1px solid; border-bottom: #d6d2c2 1px solid; background-color: #ebeadb; text-align: right" />
</eo:GridItemStyleSet>
</ItemStyles>
<Columns>
<eo:RowNumberColumn>
</eo:RowNumberColumn>
<eo:TextBoxColumn DataField="CLIENTE" HeaderText="CLIENTE" Width="300">
</eo:TextBoxColumn>
<eo:TextBoxColumn DataField="PROVA" DataFormat="{0:N4}" HeaderText="PROVA" >
</eo:TextBoxColumn>
</Columns>
<GoToBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; BORDER-TOP: #7f9db9 1px solid; BORDER-LEFT: #7f9db9 1px solid; WIDTH: 40px; BORDER-BOTTOM: #7f9db9 1px solid" />
</eo:Grid>
<div id="dettagli" style="overflow:auto; height:75px; visibility:visible;">
<asp:Panel ID="panChanges" runat="server" Visible="False" Width="400px" />
</div>
<asp:Button ID="Button1" runat="server" Text="Post Back!" />
</eo:CallbackPanel>
I dont know how to update DLL version, it's same that I had download with installer. Thanks for your patience
|
|
Rank: Newbie Groups: Member
Joined: 12/12/2007 Posts: 6
|
I was update to 5.0.16 DLL version. The results are same. Grid not show the real float Value This trim numbers without Decimals.
It shows only this format 1,800.00 and not like in real Value that is 1800,52.
it's Like ,52 was delated by grid or "," end the value.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi
5.0.12.2 is not the latest build, The latest build is 5.0.16.x, I believe only that build works properly with DataFormat.
In order to update the DLL, you would need to:
1. Exit Visual Studio; 2. Uninstall EO.Web Controls 2007.2 from Control Panel -> Add/Remove Program; 3. Download the latest from our download page; 4. Run the newly downloaded installer, that should put 2007.2.16 (5.0.16) on your machine; 5. Delete EO.Web.dll and EO.Web.dll.refresh (if exists) from your web application's bin directory; 6. Open your project with Visual Studio, switch to Solution Explorer, then delete EO.Web.dll from your Reference foloder; 7. Manually re-add a reference to Program Files\Essential Objects\EO.Web Controls 2007.2\Net20\EO.Web.dll;
Now you are on the new DLL. Run the page and let us know how it goes!
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Wolk wrote:I was update to 5.0.16 DLL version. The results are same. Grid not show the real float Value This trim numbers without Decimals.
It shows only this format 1,800.00 and not like in real Value that is 1800,52.
it's Like ,52 was delated by grid or "," end the value. This means the Grid is formatting it correctly, but did not get the value correctly. I've set up an online meeting for you if you don't mind to have us to take a look. I'll send you a private message with the online meeting address. Thanks
|
|
Rank: Newbie Groups: Member
Joined: 12/12/2007 Posts: 6
|
Thanks I'm agree with You. I'm waiting for Your message.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
I've already sent to you half an hour ago. Click "Inbox" on the top of the page to see the message.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The original issue is caused by Italian culture formatting number differently. We have posted a new build that should have resolved this issue. Please see your private message for download location of this build.
Thanks
|
|