|
Hi all
I am trying to translate reports (.rdlc files) from english into well, for starters, Portuguese. The program these reports work for, written in Visual Basic, already has a translation function that works - it translates the program fine - by passing it the string to be translated and it returns the corresponding value from a textfile recompiled to .resx . The program checks what the system language is, and accordingly selects the appropriate resource file.
My question is this - how do I translate these reports?
|
|
|
|
|
Hello all,
I've just installed a copy of VS2008 Standard, and I'm looking at the MicrosoftReportViewer, and the ability to design a new report from it. To get started with it, I'm using the wizard.
What I'm finding is that the report doesn't display anything (data), although it is displaying the header text, and field names.
The way I'm firing the report is via a button on form MultipleLicenceResponse.vb. This form has a DataGridView (dgvResponseData) on it, which gets its data from tblResponseData.
This is opening LicenceReportPreview.vb via ...
Dim frmReport As New LicenceReportPreview
With frmReport
.Licence = "Display anything in this field for now"
.LicenceTable = tblResponseData ' Just to see if I can access this instead - which I can't!
End With
frmReport.ShowDialog()
The report wizard gets its object data from the LicenceReportPreview.vb class, where I'm selecting the LicenceReportPreview as the object and, for now, just the Licence property (which should be the string, "Display anything in this field for now") .... just to get something on the report!
What am I missing? Does anybody know of a good tutorial that I can follow which shows me how to get the contents of my table onto the report?
|
|
|
|
|
Check box column getting unchecked when I am sorting column in datagridview.
Can any one can help me?
Regds.
Suman
|
|
|
|
|
Hello Suman,
I have checked this and it works fine for me. Could you please provide us a small
sample application showing the mentioned behavior.
Regards,
Allen
Allen Smith
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Imports System
Imports System.Data.SqlClient
Public Class Form1
Dim str As String
Dim con As SqlConnection
Dim da As SqlDataAdapter
Dim ds As New DataSet
Dim dt As DataTable
Dim dv As DataView
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
str = "Integrated Security=SSPI; User Id=sa;Initial Catalog=MAS08; Data Source = suman"
con = New SqlConnection(str)
con.Open()
str = "select * from unitmaster"
da = New SqlDataAdapter(str, con)
da.Fill(ds, "unitmaster")
dt = ds.Tables(0)
dv = New DataView(dt)
Dim colCheckbox As New DataGridViewCheckBoxColumn()
' Size the column width so it is wide enough to display the header
colCheckbox.AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader
colCheckbox.ThreeState = False
colCheckbox.TrueValue = 1
colCheckbox.FalseValue = 0
colCheckbox.IndeterminateValue = System.DBNull.Value
colCheckbox.DataPropertyName = "Checkbox"
colCheckbox.HeaderText = "Checkbox"
colCheckbox.Name = "Checkbox"
'colCheckbox.ReadOnly = True
dgv.Columns.Add(colCheckbox)
dgv.DataSource = dv
End Sub
End Class
|
|
|
|
|
Hi all
Please help!
How to write filter by date in macro in Excel?
Automatic generated macro looks like this:
Selection.AutoFilter Field:=10, Criteria1:=">=01.01.2007", Operator:=xlAnd, _
Criteria2:="<01.01.2008"
But this macro is not working.
Thanks
|
|
|
|
|
Hiiiii
Selection.AutoFilter Field:=10, Criteria1:=">=#01.01.2007#", Operator:=xlAnd, _
Criteria2:="<#01.01.2008#"
and also check the date format of your system is "dd.mm.yyyy" or "mm.dd.yy"
For the comparison with Date use the # character. May be this solve your problem.
Thanx
Mitesh Khatri
khatrimitesh@hotmail.com
modified on Wednesday, June 11, 2008 7:26 AM
|
|
|
|
|
Unfortunatly its not working too
|
|
|
|
|
I have a function that sometimes takes quit a while to run (always the first time)
It simply opens a crystal reportviewer, loads the report , reconnects it and sets printer and page settings.
This doesn't take but a second or so the second time you open up the crystal report viewer but the first time apperantly it does.
So now I want a small animated waiting form to be displayed while this is running.
But when I put a progressbar on it (as animation) the progressbar is frozen (put it to marquee so should be running continuasly)
I know this is because of threading (the animation form is on the same thread as the code to open the report) but there is simply no way for me to put the code for opening the report in a seperate thread.
So I try'd putting the form in a seperate thread but that didn't help (no big surprise there but I was desparet)
My last thought is to put the progressbar (or whatever animation that eventually ends up there) in a seperate thread, but I can't seem to get that working (probably not possible)
Is there any way to make the animation (progressbar / gif / ...) on the waiting form to work even when the gui threat is hanging?
With thanks for any help
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
hi,
i have written a code to connect to sql server 2005 database and
do some update and insert operation, i want to handle an exception, such
that whenever the connection to the database fails, the program should
wait for the connection to be available and reconnect..
constring = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=pwd;Initial Catalog=db;Data Source=pc1"
Try
cn.ConnectionString = constring
cn.Open()
Catch ex As Exception
Err.Clear()
System.Threading.Thread.Sleep(300000)
' cn.Close()
' cn.ConnectionString = constring
cn.Open()
End Try
End Sub
it does not seem to work, please help
asfdasdf
|
|
|
|
|
vermaratan wrote: Err.Clear()
What is Err?
vermaratan wrote: System.Threading.Thread.Sleep(300000)
Why are you waiting for 5 minutes?
vermaratan wrote: cn.Open()
If it failed the first time, what makes you think it will work again?
What is the exception? That will tell you why it failed.
|
|
|
|
|
hi,
let me put it this way.
my application is running, i want to check for the database communcation error, to simulate i have removed my network cable, due to which it gives the error, based on the error i want to trap and wait for some time and re connect, that is why i am clear the err object, and waiting for 5 minutes
asfdasdf
|
|
|
|
|
It will never work very well. What happens if it fails the second time?
Also. err.clear is vb6 (and earlier ), not .net.
heres a bit of pseudo code
while (Connect = false)
sleep a while
wend
...do some work
function Connect as boolean
try
conn.open
return true
catch
return false
end
Obviously you need to do this properly, not keep retrying for ever etc etc, but it should point you in the right direction
Bob
Ashfield Consultants Ltd
|
|
|
|
|
One of my friends is doing one VB.NET project. but she said that she always get this error "error: cannot obtain value".
The code is like that.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim f As New Foo
Dim dd As DataSet = f.SQL1_SearchLotInfo(Nothing)
Console.WriteLine(dd.Tables.Count)
Console.WriteLine(dd.Tables(0).Rows.Count)
End Sub
End Class
Public Class Foo
Public Function SQL1_SearchLotInfo(ByVal a As dataLOTBOX1) As DataSet
Dim Table1 As DataTable
Table1 = New DataTable("Customers")
'creating a table named Customers
Dim Row1, Row2, Row3 As DataRow
'declaring three rows for the table
Try
Dim Name As DataColumn = New DataColumn("Name")
'declaring a column named Name
Name.DataType = System.Type.GetType("System.String")
'setting the datatype for the column
Table1.Columns.Add(Name)
'adding the column to table
Dim Product As DataColumn = New DataColumn("Product")
Product.DataType = System.Type.GetType("System.String")
Table1.Columns.Add(Product)
Dim Location As DataColumn = New DataColumn("Location")
Location.DataType = System.Type.GetType("System.String")
Table1.Columns.Add(Location)
Row1 = Table1.NewRow()
'declaring a new row
Row1.Item("Name") = "Reddy"
'filling the row with values. Item property is used to set the field value.
Row1.Item("Product") = "Notebook"
'filling the row with values. adding a product
Row1.Item("Location") = "Sydney"
'filling the row with values. adding a location
Table1.Rows.Add(Row1)
'adding the completed row to the table
Row2 = Table1.NewRow()
Row2.Item("Name") = "Bella"
Row2.Item("Product") = "Desktop"
Row2.Item("Location") = "Adelaide"
Table1.Rows.Add(Row2)
Row3 = Table1.NewRow()
Row3.Item("Name") = "Adam"
Row3.Item("Product") = "PDA"
Row3.Item("Location") = "Brisbane"
Table1.Rows.Add(Row3)
Catch
End Try
Dim ds As New DataSet()
ds = New DataSet()
'creating a dataset
ds.Tables.Add(Table1)
Return ds
End Function
End Class
Public Structure dataLOTBOX1
Dim TDATE As Date
Dim BOX As String
Dim UTACLOTID As String
Dim RLOTID As String
Dim CUSTLOTID As String
Dim PARTID As String
Dim SUPPLIERID As String
Dim INPART As String
Dim OUTPART As String
Dim DATECODE As String
Dim STAGE As String
Dim CUSTDEVICE As String
Dim CUSTOMERPACKAGE As String
Dim PACKAGESIZE As String
Dim PINCOUNT As Integer
Dim TOTALQTY As Integer
Dim TB1 As Integer
Dim TB2 As Integer
Dim TB3 As Integer
Dim TB4 As Integer
Dim TB5 As Integer
Dim TB6 As Integer
Dim TB7 As Integer
Dim TB8 As Integer
Dim TB9 As Integer
Dim TB10 As Integer
Dim TB11 As Integer
Dim TB12 As Integer
Dim TB13 As Integer
Dim TB14 As Integer
Dim TB15 As Integer
Dim TB16 As Integer
Dim TB17 As Integer
Dim TB18 As Integer
Dim TB19 As Integer
Dim TB20 As Integer
Dim AB As Integer
Dim EB1 As Integer
Dim EB2 As Integer
Dim EB3 As Integer
Dim EB4 As Integer
Dim EB5 As Integer
Dim EB6 As Integer
Dim FB As Integer
Dim DEFAULTFLOW_LOTBOX As String
Dim NEWBOX As String
Dim FINALFLOW As String
Dim ITEM As String
Dim STATUS As String
Dim OLDSTATUS As String
Dim REMARK As String
Dim TRANID As String
Dim INAME As String
Dim IEMPLOYEE As String
Dim IDATE As Date
Dim CNAME As String
Dim CEMPLOYEE As String
Dim CDATEE As Date
Dim ANAME As String
Dim ADATE As Date
Dim WOFFICER As String
End Class
The problem is that it's not possible to include more than 59 fields or 60 field in one structure. Due to some many reason, she said that she need to include more 60 fields in that structure. So, I suggested her to use a class with "public shared" instead of structure. but I wanna know why we can't have more than 59 fields or 60 field in one structure?
thanks in advance.
|
|
|
|
|
From what I understand, structures are value types, and as such are created on the stack. This would mean there is a limit to their size, but 59-60 fields seems rather small!
Classes are reference types, so dont have this same limitation - I think they are stored on the heap.
Of course, I may be totally wrong - please correct me if I am.
Reading here http://www.pcreview.co.uk/forums/thread-1397441.php[^] has someone with a similar issue... and it seems to back up what I initially thought.
I'm glad you asked that question... I am going to be much more wary of structures now
|
|
|
|
|
Like I said here[^], I'm not really sure that this is a problem with DataSet or that structure. It's really weired.
but from the link that you gave me, it said that a structure should be under 16 KB. maybe. that's the reason.. but what's wrong with dataset?
|
|
|
|
|
Well, I just stuck your complete code snippet in, and when I run it, it gives the correct values: 1 & 3.
I notice there is a try/catch block with no exception handling - perhaps that is hiding the real issue?
But, as the link suggested, try using ByRef for passing the structure.
Public Function SQL1_SearchLotInfo(ByRef a As dataLOTBOX1) As DataSet
This will conserve memory when passing the structure.
|
|
|
|
|
Yes. There is no error in my code. but ~
put the breakpoint on this line " Console.WriteLine(dd.Tables.Count)". then run the application and see the dd.Tables.Count in Quick Watch Window. You will see ""error: cannot obtain value"." ..
Remove the parameter (ByVal a As dataLOTBOX1) from SQL1_SearchLotInfo() function. then, run and check the dd.Tables.Count in Quick Watch Window again. You won't see any error.
|
|
|
|
|
Okay. I see what you mean now.
In my IDE I get the following error message:
"Cannot evaluate expression because we are stopped in a place where garbage collection is impossible, possibly because the code of the current method may be optimized."
This is probably just an issue with the debugger... the code functions properly - just the watch window that goes a bit doo-dah.
HOWEVER,
As mentioned before:
Public Function SQL1_SearchLotInfo(ByRef a As dataLOTBOX1) As DataSet
does NOT have this issue.
Converting the structure to a class (highly recommended) does not have this issue.
|
|
|
|
|
Jasey9 wrote: This is probably just an issue with the debugger... the code functions properly - just the watch window that goes a bit doo-dah
but I tried to get the value in immediate window but not working. I tried to bind the dataset with datagrid but no result is shown. So, I'm not really sure that this is a debugger error or etc.. but you know. if a structure can't handle that much large field, they should doc it.
Jasey9 wrote: Converting the structure to a class (highly recommended) does not have this issue.
Yes. Thanks. I have changed it to a class.
|
|
|
|
|
Michael Sync wrote: The problem is that it's not possible to include more than 59 fields or 60 field in one structure. Due to some many reason, she said that she need to include more 60 fields in that structure. So, I suggested her to use a class with "public shared" instead of structure. but I wanna know why we can't have more than 59 fields or 60 field in one structure?
I wasn't aware of the limitation on a structure. However, it seems a sensible thing. Structures are value types and are copied any time they are assigned or passed into a method and so on. Because of all that copying it makes sense to keep the size of the structure small (I think 16 or 32 bytes is a reasonable maximum).
Classes are reference types and only the reference is copied which means the data isn't copied unless you explicity copy it.
I would recommend that creating a class for this data is a better option than a structure.
|
|
|
|
|
Michael Sync wrote: a class with "public shared"
Also, I don't recommend that the class is Shared (static in C#) because you won't be able to create instances of it.
|
|
|
|
|
Thanks for your reply. Colin.
Colin Angus Mackay wrote: I don't recommend that the class is Shared (static in C#) because you won't be able to create instances of it.
thanks. but there are some codes that she used like structure without creating an instance.
but one thing. Please take a look at "SQL1_SearchLotInfo" in my previous message.
1) There is a parameter in that function.
2) The code that I wrote in that function is just for creating a dataset at runtime. (nothing much)
3) I'm returning that dynamically generated dataset from that function.
(I did nothing with that structure or that parameter.)
My question: Why does that dataset give the error when I use that structure as a parameter? What is the relationship between that structure (parameter) and returned dataset? I tried to return a boolean value and it was working fine. Just having a structure as a parameter in that function makes dataset up-side-down?
|
|
|
|
|
Michael Sync wrote: My question: Why does that dataset give the error when I use that structure as a parameter?
Sorry, I don't see where you are using a as a parameter to the dataset. Could you highlight the correct line of code for me please.
Michael Sync wrote: Just having a structure as a parameter in that function makes dataset up-side-down?
Bottom line is that a structure with over 50 fields in it is not sensible. I don't know the answer to your qestion because I would never have a structure that large in the first place. It is highly inefficient and memory intensive.
|
|
|
|
|
Colin Angus Mackay wrote: Sorry, I don't see where you are using a as a parameter to the dataset. Could you highlight the correct line of code for me please.
Yes. There is no error in my code. but ~
put the breakpoint on this line " Console.WriteLine(dd.Tables.Count)". then run the application and see the dd.Tables.Count in Quick Watch Window. You will see ""error: cannot obtain value"." ..
Remove the parameter (ByVal a As dataLOTBOX1) from SQL1_SearchLotInfo() function. then, run and check the dd.Tables.Count in Quick Watch Window again. You won't see any error.
|
|
|
|