|
ii_noname_ii wrote: The client wants a popup window correctly sized...
He also wants it to work for everyone, which is not the case atm with my javascript window.opens...
That is not possible. To open a window at a specific size you need to use Javascript, but as you can disable Javascript or certain Javascript functions in the browser (or using a popup blocker), that can not work for everyone.
ii_noname_ii wrote: In any case, this really seems like a missing functionality in vb.net ...
It has nothing to do with VB.NET what so ever, as you are opening the popup in the browser.
ii_noname_ii wrote: What about those nasty crack/serial, or porn pages that manage to open popups in your face, despite your popup blocker?
Popup blockers may have settings for what popups it allows. If a site manages to follow these rules, it can use a popup. There is also the possibility that the popup is not a popup at all, but just a part of the page that looks like a popup.
---
b { font-weight: normal; }
|
|
|
|
|
Hi everyone,
Not sure if this is the right place for crystal report posts but here I go.
I have a windows application that has been coded in vb.net, in VS2003. the database is MS Access based. I am working on a quotation system and have completed the forms that the user will utilize for input. The windows apps created are not bound to the database and store a local dataset that holds all of the information/tables/data that the user has came in contact with. I would like to create reports that will be populated based on the local dataset. I was wondering if there is any way to create a crystal report, to be used as the template, without binding the report to the database, and then passing the local dataset data into the report that needs to be printed. I have read online about a push method, but they say that can be really slow in creating a report with lots of tables and data, and all of the other solutions are for vs2005. Thank you for reading this post, I am new to crystal reports and am looking for any tutorials etc that might help with this problem. Thank you.
eatwork
|
|
|
|
|
eatwork wrote: working on a quotation system
eatwork wrote: not bound to the database
Just a question - don't you think it would be nice (from a customer services point of view) to keep track of quotes and use them as follow-ups? e.g. If the quote was not accepted, why not?
Your app, just a suggestion.
eatwork wrote: create a crystal report, to be used as the template, without binding the report to the database, and then passing the local dataset data into the report that needs to be printed.
Sure there is & it's real simple. Build your template report first and pass the dataset to the method that calls the report, e.g.
'declare pre-built report
Public myReport1 = New myCrystalReport
Public Sub BuildMyReport(ByVal ds As DataSet)
myReport1.SetDataSource(ds)
myForm.myReportViewer.ReportSource = myReport1
End Sub
Is that what you're after?
|
|
|
|
|
Thank you for your reply and insight. I currently do store the quotes in a database but do not store the reasons why they might/might not have been accepted. But I will ask the users if that is something they would like in the system.
I tried the code you suggested, but it doesn't seem to be working for me. The form opens, but without a report in the report viewer. This code is in the pop up form after the user clicks on a button and I call the forms showdialog method
my code:
<br />
Private Sub Form_Load()<br />
myReport1.SetDataSource(Me.p_dataset)<br />
Me.CrystalReportViewer1.ReportSource = myReport1<br />
End sub<br />
also tried<br />
Private Sub Form_Load()<br />
myReport1.SetDataSource(Me.p_dataset)<br />
Me.CrystalReportViewer1.ReportSource = myReport1.FilePath.ToString<br />
End sub<br />
Do you know of any place on the internet that might give me a tutorial to create a "template report"? All of the reports I have seen online are databinded to a database or have a database/xsd file that it reads data in from. I can't really use those examples because my dataset is created at runtime. I am fairly new to .net and coding, and have never done a crystal report through the integrated crystal reports in vs2003. Thank you very much
eatwork
|
|
|
|
|
Ok, I did up a small sample app to demonstrate how to get this right. Here's how I did it.
I started off by creating a form with 3 textboxes to input data to the dataset (I chose "Name", "Product" & "Quantity" as fields for the dataset), and 2 buttons for "Add to dataset" & "View report".
I created the dataset (called dsQuote) and declared it at modular level in Form1 (Friend ds1 As New dsQuote )
I created a second form and added a Crystal Report Viewer to it (called "crv")
I added a new Crystal Report to the solution and used the Report Expert wizard to select the dataset i created earlier.
I set the solution start up object to call Sub Main() .
Then I just tied it all together with a bit of code - have a look at the code below.
SubMain
Module modMain
Public WithEvents frm1 As Form1
Public WithEvents frmR As frmReport
Sub Main()
frm1 = New Form1
Application.Run(frm1)
End Sub
End Module
Code on Form1
Friend ds1 As New dsQuote
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim dr As DataRow = ds1.tblQuote.NewRow
'add info to dataset
dr.Item("name") = txtName.Text
dr.Item("product") = txtProduct.Text
dr.Item("quantity") = txtQuantity.Text
ds1.tblQuote.Rows.Add(dr)
'clear the textboxes
txtQuantity.Clear()
txtProduct.Clear()
With txtName
.Clear()
.Focus()
End With
End Sub
Private Sub btnReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReport.Click
frmR = New frmReport
frmR.Show()
End Sub
Code on Form2
Public rptQ As Quote
Private Sub frmReport_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
rptQ = New Quote
rptQ.SetDataSource(frm1.ds1)
Me.crv.ReportSource = rptQ
End Sub
That should solve it for you.
EDIT: Sorry for the crappy naming conventions, I was in a bit of a hurry.
-- modified at 3:59 Friday 18th August, 2006
|
|
|
|
|
Hi kulazfuk,
Awesome sample, it works! Not quite what I was expecting, and I guess I need to create a blank xsd for it..but it works and thats all that matters. Thanks a lot for your help
eatwork
|
|
|
|
|
sorry, ignore the last post, starting to confuse myself. Thanks again
eatwork
|
|
|
|
|
Hey I'm very new to this so please forgive me. What I'm trying to do is send text to a text box without having the user click a button. What I want to do is this; I have a very small basic program that takes user input from different text boxes, drop down list, etc and creates a .txt file. I have a button on a separate tab that when clicked will give them a preview of what they have picked in the various locations. What I want to do is an instant send once they click the information in the text boxes, drop down, list boxes, etc... What do I need to do to accomplish this?
|
|
|
|
|
All controls have a collection of events that you can handle.
For example, you could use the TextChanged event for a textbox and SelectedIndexChanged for a combobox.
Steve
|
|
|
|
|
Thanks to reply Kereskowiak,
Actually i want that my project should work like "Trial Versions" does.
If project is installed on one machine then it should expire itself after 10 days of installation.
if someone try to install it again after changing the system date then it should check that, has project been installed on same machine before or not? if yes then it should stop installation.
I want to do such stuff for Piracy point of view of project.
Waiting for solution.
Regards,
Syed Ali Raza Rizvi
|
|
|
|
|
Syed Ali Raza Rizvi wrote: Thanks to reply Kereskowiak,
His name is Dave, and you should respond on the same thread, so he can see it and so it's in context.
Syed Ali Raza Rizvi wrote: Actually i want that my project should work like "Trial Versions" does.
Then you need to store some info somewhere that is hard to find, and that shouldn't be the registry IMO.
The only way to do this so that there is little chance of a determined user to crack it is to do something user hostile, like hide files in the System32 folder to track the dates.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The Registry is always the first place people look in when trying to "break" your program.
To protect your programs, You could have a look at my article here :
http://www.codeguru.com/vb/gen/vb_general/ideincludingvisualstudionet/article.php/c11817/[^]
In there (the second page) I create a Trial Application ,storing a counter variable in a "system" file. Then, when the counter reaches a certain number, the person cannot continue.
Hope that helps!
H T G
|
|
|
|
|
I'm trying to use the WebClient.DownloadData method running on two threads at the same time. This sometimes produces an interrupt if both threads try to run it at the same time (the method can only run on one thread at a time). How can I best synchronize, for instance by getting one of the threads to wait until the other is finished downloading?
thanks!
|
|
|
|
|
You could use thread polling, Thread.Join or Wait handles.
Search your help file for one of the above.
Steve
|
|
|
|
|
I think I wasn't real clear... I have the 2nd thread in a backgroundworker. Can I use those techniques in this case? Do I need to determine the thread name of the backgroundworker?
Thanks
|
|
|
|
|
They are competing with the same resource?
Link them both to the same 'Wait handler', then one will wait for the other to complete.
Steve
|
|
|
|
|
Hi again.
Can you give me an example of the "wait handler" code? I'm trying to sort this out.... but I'm not too good at it!
I have my primary thread running.
Then I call a secondary thread (backupworker)
They both keep running continuously, and they both need to call
WebClient.DownloadData() at random intervals.
I put the webclient call in a function (Myfunction), so that both threads call the same function. Is this OK?
It looks to me like what I want are:
System.Threading.Monitor.Enter(Myfunction)
System.Threading.Monitor.Exit(Myfunction)
But I don't know exactly where to put them, or if this is right.
Thanks so much for your help!
chuck
|
|
|
|
|
What you ask is quite complicated and depends on exactly what you are trying to do and how you are doing it. Since I don't know your application or your code structure, it is difficult to advise the best method to achieve what you desire.
I really would suggest that you search your help file for information on thread pooling, thread.join and wait handles. You need to understand what you are doing and how relevant it is to what you are trying to achieve.
Giving you the code will not teach you anything and since I don't know your application, may not be the best way to get the results you desire.
Steve
|
|
|
|
|
If all you are trying to do is ensure that only one thread can execute your method at any given time, the easiest solution would be to prefix the method definition with the MethodImpl attribute.
For example:
<methodimpl(methodimploptions.synchronized)> _
Public Function MyFunction as foo
'Function functionality coded as normal
End Function
This attribute ensures that only one thread may execute the method at any given time.
You could also use SyncLock to achieve the same result:
Public Function MyFunction as foo
SyncLock Me
'Function functionality coded as normal
End SyncLock
End Function
Any code within the SyncLock block can only be executed by one thread at a time.
Hope this helps.
|
|
|
|
|
Keith... perfect! .... you are the MAN! thanks again!
|
|
|
|
|
I modified the column structure schema of my database. This update is reflected OK in the database explorer. But it is not represented in the dataset designer. My program seems to think the old column structure is still in place. How can I update the column structure?
ty!
|
|
|
|
|
You probably need to use the XML Designer and update the schema of your dataset.
Steve
|
|
|
|
|
Steve.. I think you helped me, because I discovered that I needed to...
go to datasources, right click on dataset and open the dataset configuration wizard.
DO NOT TRY TO EDIT THE DATASET YOURSELF!!! DISASTER!
thanks
chuck
|
|
|
|
|
I am trying to build an interface that returns a datetime data field using an OleDbDataAdapter. The CommandText used by the SelectCommand is "SELECT Punch FROM TIME_POST_WORK". If I run this query from within Query Builder the data returned is "6/19/2006 12:57:58 PM". However, if I try to fill my dataset by using the Preview Data assoctiated with the OleDbDataAdapter, it only returns "6/19/2006". I need to return the value as a DateTime, not just a Date only. I am using Visual Studio .NET 2003 and I get the same results if I am hitting an Access database or a SQL database.
|
|
|
|
|
Can you supply some of your code?
How are you testing what is in your DataSet?
Steve
|
|
|
|