|
I usually set my DataSource to a DataTable in the DataSet (lst.DataSource = ds.Tables("MyTable")) or to a DataView. Then the binding code is:
<%# DataBinder.Eval(Container, "DataItem(""MyFieldName"")") %>
|
|
|
|
|
Hi!
I am having a trouble exporting my report to pdf. Everytime I'll click on the export button, the page runs to a blank page. Also, there are times when i click the export button, an error occurs saying "Logon Failed" Here's my code. Hope you can help me
Private Sub cmdExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExport.Click
oStream = New MemoryStream
oStream = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Response.Write(oStream)
Response.End()
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"
Response.BinaryWrite(oStream.ToArray())
Response.End()
End Sub
Thanks!
|
|
|
|
|
mizu_chil wrote:
Logon Failed
I believe, that you must provide information about the database location, user name, and password. '
mizu_chil wrote:
oStream = rpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Where did you create the rpt ?
<italic>Work hard, Work effectively.
|
|
|
|
|
hi!
do you have a sample code that i may look at,,, or if you wouldn't mind, can i ask you to write the step-by-step instruction,,,
tnx for the reply!
|
|
|
|
|
For logon problem, see this.[^]
<italic>Work hard, Work effectively.
|
|
|
|
|
im sure its possible to open up a dll during runtime so you can somewhat explore what objects are in it, but how do you do it? ive tried messing around with things in the System.Reflection, mostly with the Assembly object in that, but cant seem to figure it out.
any ideas?
thanks
|
|
|
|
|
It's fairly straightforward, look for the System.Runtime.Reflection namespace. You'll find Assembly.LoadXXX methods to load an assembly. Those methods return an Assembly reference, on which you can call GetTypes() . You can then iterate through the Type array returned by it and display whatever information you want to.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
PeriodAdapter.Fill(DataSet11, "period")
Dim datatable As DataTable = DataSet11.Tables("Period")
Dim dr As DataRow = datatable.NewRow
Dim r() As DataRow = datatable.Select("periodno= max(periodno)")
Dim i As Integer
For i = 0 To r.Length - 1
dr("periodno") = CInt(r(i)("periodno")) + 1
dr("begindate") = DateTimePicker1.Value.Date
dr("enddate") = DateTimePicker2.Value.Date
datatable.Rows.Add(dr)
Next
MsgBox("New period has been saved", MsgBoxStyle.Information, "New Period")
PeriodAdapter.Update(DataSet11, "period")
--------------------------
Well i havent search from internet about this fucntion yet and above code is just what i modify a bit and use for generate new id or number to my record by adding 1. The problem is if there are not records at database, above code cannot add the first record let said periodno =1 ........... and keep giving blank record when i see at my database. if i manually insert periodno=1 then above code can give the next periodno=2.
How to make condition if my database is empty, i tried use Nothing syntax also cannot. What should i do....
|
|
|
|
|
Hi,
first of all: If your periodno is unique you won't need the loop.
To your question: If you don't have any entries in the Period table the Select function will return an empty array:
PeriodAdapter.Fill(DataSet11, "period")
Dim datatable As DataTable = DataSet11.Tables("Period")
Dim dr As DataRow = datatable.NewRow
Dim r() As DataRow = datatable.Select("periodno= max(periodno)")
Dim nextPeriodNo as Integer
If (r.Length == 0) Then
nextPeriodNo = 1
Else
nextPeriodNo = CInt(r(i)("periodno")) + 1
End If
Dim i As Integer
dr("periodno") = nextPeriodNo
dr("begindate") = DateTimePicker1.Value.Date
dr("enddate") = DateTimePicker2.Value.Date
datatable.Rows.Add(dr)
MsgBox("New period has been saved", MsgBoxStyle.Information, "New Period")
PeriodAdapter.Update(DataSet11, "period")
|
|
|
|
|
Hello there
I am creating a folder(s) on the server through my application and want no one to access that folder without providing a password on it. even administrator has to provide the folder(s) password before accessing it.
any idea's
|
|
|
|
|
It is possbile but requires your to write a file system extension. This is NOT easy and requires a deep understand of the internals of NTFS and COM.
Your first step is to order the Windows Device Driver Development kit.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello there
I want to build an application which will convert the text into image . I tried through simple Drawing functions and manage to solve it for text files. but as far the word document or html files are concerned it has problem. as Word has some special headers which are not visible in word but are visible if you open them in text file. and in HTML it make an image of source code.
any ideas would be apprciated..
|
|
|
|
|
You'd have to use Word Automation for that. Instead of directly using the doc files generated by Word, you must open them through Word and get their contents. Google for "MS Word Automation" and you should get plenty of help.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I need some help with code or the code for a small string encryption function.
On a command button press, I basically need all the values, either letters or numbers, to be sent to a text file.
I know the App.Path code, and the basic way in which to send text values from text boxes into the App.Path file.
All I need is a way in which to take the characters inside each of the text boxes and encrypt them, and send that info to the App.Path file.
MChr$(Asc(Mid$(Smurg, l, 1)) Xor 7) <--- This sort of thing I believe.
If anyone can post something similar or give me some hints, I'd be greatful.
Thanks in advance,
Smurg.
Smurg.Enabled = True
|
|
|
|
|
hi
i wish to make a form or splash screen that contain Flash
can it be done?
kindly guide me on this...if possible is there any tutorial?
thank you in advance
Gary
|
|
|
|
|
The only way that I can see how do what your asking is by using a browswer object in the form. Generate an html file that can be read by the browser.
Or
Maybe you can interface with the Macromedia API's..........
|
|
|
|
|
|
If this time i enter textbox1.text = "Company Name"
Next time when i open my application the textbox1.text default will be appear that "CoOmpany Name" again and not empty textbox1.text
|
|
|
|
|
You can save that in a file setting or in the registry. The next time your application start, read and show that value.
<italic>Work hard, Work effectively.
|
|
|
|
|
Add this following line into Command button click event or
in LostFocus Event of TextBox:
SaveSetting "ApplicationName", "Section", "Key"
Add this line in form Load Event:
TextBox = GetSetting("ApplicationName", "Section", "Key")
|
|
|
|
|
Can explain it step by step?
thx
|
|
|
|
|
Hi
I think syed saba was clear enoughm but I explain him a little more for you:
Write:
Private Sub Text1_LostFocus()
call SaveSettings( "YOUR APPLICATION NAME", "SAVEDVALUES", "TEXT1VALUE", Text1.Text)
End Sub
Private Sub Form1_Load()
Text1.Text = GetSettings( "YOUR APPLICATION NAME", "SAVEDVALUES", "TEXT1VALUE" )
End Sub
Remember that ANY string that I wrote in CAPITAL LETTERS, is any optional string that you may choose yourself.
need more help?
|
|
|
|
|
I mean the SaveSettings and GetSettings im not really understand it. They are not vb.net default code right? I got it underlined and "name saveSettings is not declared".
|
|
|
|
|
I know how to do this in C or in perl but cannot figure out how to do this in VBscript... Is Vbscript just not robust enough?
I do not know.
I want to execute a simple dir command and read the output. thats it.
I MUST use the console (cmd.exe dir.) in the other languages I know reading from a shell command is simplicity itself vbscript seems to not have this capability.
|
|
|
|
|
On the contrary, it does have this ability and you don't need the console to do it. You need to use the FileSystemObject[^] to return a Folder object, which wil have a Files property that gives you all the files in that Folder.
Dim fso, fldr, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set fldr = fso.GetFolder(folderspec)
For Each f in fldr.Files
WScript.Echo "File: " & f.name
Next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|