|
Hi,
I'm using crystal report viewer for loading my Crystal Reports in form.When I'm selecting a record from a datagrid,I'll be generating the report for the particular InvoiceNo.Both the Datagrid and Crystal Report Viewer are in same form.
When I'm selecting the record,the report is generated.After that when I refresh,the datagrid is displayed.After Refres,When I select a record,the report is generated,but on click of Crystal Report Viewer,report is being generated for other InvoiceNo instead of the selected one.
Can anyone let me know the cause for this and How could we resolve this?
Thank you,
Regards,
Deepa!
|
|
|
|
|
You need to show some code related to selection of InvoiceNo in grid so that we can help.
Shreekar
|
|
|
|
|
Hi,
For Datagrid Display!
private void ugdDeliveryOrderListLoad(string vCustNo)
{
StringBuilder stbSQLStatement1 = new StringBuilder();
stbSQLStatement1.Append(" select dbo.MARTblInvoice.[InvoiceNo] As [Delivery Note No] ");
stbSQLStatement1.Append(", dbo.MARTblInvoice.CustNo ");
stbSQLStatement1.Append(", dbo.MARTblInvoice.SoldToCustName ");
stbSQLStatement1.Append(", dbo.MARTblInvoice.DeliverToCustName ");
stbSQLStatement1.Append(", dbo.MARTblInvoice.IssuedDate ");
stbSQLStatement1.Append(" from dbo.MARTblInvoice left outer join dbo.MARTblCustomer ");
stbSQLStatement1.Append(" on dbo.MARTblInvoice.CustNo = dbo.MARTblCustomer.CustNo ");
//stbSQLStatement1.Append(" where dbo.MARTblInvoice.[InvoiceNo] = "+ ugDeliveryOrderLlist.ActiveRow["Delivery Note No"] + " ");
stbSQLStatement1.Append(" Where dbo.MARTblInvoice.IsCreateDeliveryOrder = 1 ");
stbSQLStatement1.Append(" and dbo.MARTblInvoice.InvoiceNo not like 'D%' ");
stbSQLStatement1.Append(" and dbo.MARTblInvoice.CustNo like '"+vCustNo+ "%' ");
stbSQLStatement1.Append(" and dbo.MARTblInvoice.DOPrintCounter <= 2 ");
stbSQLStatement1.Append(" and dbo.MARTblInvoice.InvoiceNo in ");
stbSQLStatement1.Append(" ((Select InvoiceNo From MARTblInvoiceDetailProduct) ");
stbSQLStatement1.Append(" UNION ALL ");
stbSQLStatement1.Append(" (Select InvoiceNo From MARTblInvoiceDetailNonProduct)) ");
stbSQLStatement1.Append(" and dbo.MARTblCustomer.GroupKeyID like '"+ GroupKeyID +"%' ");
stbSQLStatement1.Append(" order by [Delivery Note No] Desc ");
DataSet dtsResult1 = new DataSet();
dtsResult1 = QueryData(stbSQLStatement1.ToString());
ugDeliveryOrderLlist.DataSource = dtsResult1;
if(dtsResult1.Tables[0].Rows.Count == 0)
{
MessageBox.Show("No Results Found. ","DuPont MARS",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
}
ugDeliveryOrderLlist.DataBind();
}
On selecting the record,
Grid_AfterSelectChange event
pnlReport.Visible = true;
DisplayReport();
utmDataMaintenance.Tools["Print"].SharedProps.Enabled = true;
I'm using crv(Crystal Report Viewer)Is that the reason,Everytime when I scroll on the generated report,report is being generated again for other invoice no.
What might be the workaround for this?
Thank you,
Regards,
Deepa.
|
|
|
|
|
Hi all,
I have a vb.net dll that I wrote and when it is launched from a desktop (windows) application it displays a small window down by the clock to tell the user what is going on. This works great. I ported this dll to an asp.net program and of course the local small window won't pop up because the .dll is not on the local machine.
What I would like to know is there anyway to tell if my .dll was called from a windows app or a web app. I would like to do different things.
I already tried system.reflection.assembly.getcallingassembly but it only returns that my dll's location and not (um let's say iexplorer.exe)
Cheers,
Chris
|
|
|
|
|
you could do something "cheap" by setting a flag in the dll from your windows app and not set it from your wep app. then throughout the code, just check the flag to determine what is allowed...
|
|
|
|
|
HI,
thanks for your reply, however I won't be the one calling the dll it will be called from many 3rd party software products. So that no worky.
Cheers,
|
|
|
|
|
Hi all,
I have a vb.net dll that I wrote and when it is launched from a desktop (windows) application it displays a small window down by the clock to tell the user what is going on. This works great. I ported this dll to an asp.net program and of course the local small window won't pop up because the .dll is not on the local machine.
What I would like to know is there anyway to tell if my .dll was called from a windows app or a web app. I would like to do different things.
I already tried system.reflection.assembly.getcallingassembly but it only returns that my dll's location and not (um let's say iexplorer.exe)
Cheers,
Chris
|
|
|
|
|
wrote: I ported this dll to an asp.net program and of course the local small window won't pop up because the .dll is not on the local machine.
On top of that, the little window won't pop up because your .DLL code is not running on the client workstation. An ASP.NET app is a server-side application that generates HTML for a browser. Your code won't run, and won't show an icon, on the clients machine. You're limited to using Java and other Browser-based languages and scripting on the client side. Besides, anything you call in your .DLL will tell you that the process is the IIS ASP.NET process, not IEXPLORER.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi everyone,
In VB6, I used PopUpMenu method on a right-clicked MouseDown event to show a ContextMenu inside the listview and that all that action does, it does not select or de-select any listview items. In .Net, if my mouse is not hovering over a selected item, my current selection is deselected when the contextmenu opens. I'd tried using a array to hold onto the current selections and reselect everything when the menu opens but it's a performance hit when there's a couple hundred items.
I cant seem to stop .Net from changes my selection. I just need the right mouse button to show the ContextMenu and nothing else.
Sorry if I cant elaborate anymore..
|
|
|
|
|
Please dont cross post.
You can store the current selections in a variable, and restore them when a right click event occurs, if the control won't let you stop it from deselecting overall.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank you for your suggestion Christian.
I was trying to avoid have to constantly reselect all the items.
Thank you anyways.
|
|
|
|
|
I think I solved it. I created my own class that inherits the ListView class. I messed around with overriding the WndProc method. I made a few small changes and it works great as far as I can tell. If you add this class to your project you should be able to use it just like any other control. It will be added to the tools menu automatically (at least it gets added for me). Sometimes I have to run my application once before it gets added. If you have trouble getting it to work let me know. It works exactly as a ListView control except for the fact that it won't change selections if you click off of an item. If you want it to behave slightly differently then let me know and I can help you make the changes. For instance do you want the context menu to appear if a user clicks off of an item? I can stop that too. Or would you like it to not select an item at all when the context menu is displayed? I would recommend leaving that behavior because it seems standard. Well here is that class. Hope it helps.
Public Class ListView_NoRightClickChange
Inherits ListView
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
'Right mouse button message ID
Const WM_RBUTTONDOWN As Integer = &H204
If m.Msg = WM_RBUTTONDOWN Then
'Mouse position relative to me
Dim mousePos As Point = Me.PointToClient(Me.MousePosition)
'If item wasn't selected then change message to prevent
'selection changes
If Me.HitTest(mousePos).Item Is Nothing Then
m.WParam = New IntPtr(-1)
End If
End If
MyBase.WndProc(m)
End Sub
End Class
**EDIT**
I re-read your post and I think that you would like the selection to stay the same even if a user right-clicks a non-selected item. If that's the way you'd like it then it's even less code. Here is the class that will make that happen.
Public Class ListView_NoRightClickChange
Inherits ListView
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
'Right mouse button message ID
Const WM_RBUTTONDOWN As Integer = &H204
If m.Msg = WM_RBUTTONDOWN Then m.WParam = New IntPtr(-1)
MyBase.WndProc(m)
End Sub
End Class
|
|
|
|
|
Hi TwoFaced,
That is exactly what I want to do.
Forgive my ignorance, but I dont have much experience using class.
I'd added a new class with the codes you posted, but am at a lost as to how to use it with my existing listview.
|
|
|
|
|
You won't be using it with your existing ListView, it's meant to replace your ListView. It's a new control if you will. However if you drop in onto your form and give it the same name as your current ListView it should integrate seemlesly into your application, because in reality it's just a ListView with a small tweak. Same events, methods etc.
Hopefully if you done the following the control will appear in the tools menu.
1) Create a new class and add the code I posted
2) The control should appear in the tools menu automatically
- If it doesn't appear you may need to run your program once
- this seems to refresh that list for me.
3) Drag and Drop the control onto your form and you are ready to go.
Let me know how you make out.
|
|
|
|
|
Thank you!!
I couldnt find it because only the "All Windows Form" was showing, and I finally found it in the "WindowsApplication1 Components" box.... guessing it matches my project name.
It would've been if we had the ability to suppress the events directly.. but you got me going.
|
|
|
|
|
Yes, you'd think there would be an easier way of controling that behavior. I find it a bit strange that there isn't at least an ability to suppress a mouse click. We can suppress keyboard keys so why not mouse clicks. In this case however it may not have been enough because you still want the context menu to appear. Anyway's, who knows maybe there is simple solution and I missed it However, I assume you looked for an obviouse answer and I know I did. So were 0 for 2. Glad you found the control and I assume all is working.
|
|
|
|
|
Well thanks !
I am using a Canon EOS with a Canon SDK, and an Allmotion servo control and a Garmin GPS
I can use
Using com1 As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort("COM4")
on error return
com1.WriteLine(CommDataOut)
End Using
to get to the servo (it is still a bit flaky) - I am using CP2100 usb-to-uart bridge software and it shows in the device window as COM4
Next task is to scan the ports to get the location of the (serial usb) devices - I wil target the Garmin GPS 60 first
Any Ideas ??
Thanks !!
bob
|
|
|
|
|
There is nothing that will scan the ports for a device for you. You have to write the code to attempt to open each COM port using the settings that the device expects (baud, bits, parity, stop bits, ...). If the port opens, you then try to send a command that the device expects and see if you get a correct repsonse. If so, you found it! If not, try the next port.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
This may seem like a very basic question, but im a novice!
I have an MDi form, and i want to load up my other vb.net forms into it, so basically, running my application from within the MDi form.
Can someone give me some advice on this as it is stressing me out a bit!
Thanks
|
|
|
|
|
I use them quite a bit in C# and they are for the most part quite easy. There is a very good article IMHO SuiteApp
That is a great example of how to get started with the Mdi Forms. Just to get you started use the IsMdiContainer property to get the Mdi parent setup then set the children to open inside of the parent. The C# example will give you the syntax you need to Load the child forms. I have written a couple of app frameworks in .net 1.1 and 2.0 that are very similar and it really becomes easy after awhile.
By the way if Mark's example helps give him a good review it takes a lot to write an article.
|
|
|
|
|
I wonder can someone help me with a project im working on
I am currently creating an WebSite in asp.net, which links to some crystal reports. Now im new to asp.net and dont have an advanced level of VB knowledge. However i was able to view the reports on an .aspx page using the crystalreportsviewer object. Now what im trying to do seems extremely simple but yet i havent found a simple explanation on the web.
My report designed in VisStudio 2005, prompts for a parameter before executing and displaying the result. So simply, what i would like to do is link to the report and pass this parameter without having to manually enter it on the webpage!
So i am going to pass the value via a querystring into the page to contains the viewer, upon which the code will set this value as the parameter and request the report! Here's the code i have with just the viewer;
<br />
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><br />
<%@ Register TagPrefix="CR" Namespace="CrystalDecisions.Web" Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" %><br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<br />
<html xmlns="http://www.w3.org/1999/xhtml" ><br />
<head runat="server"><br />
<title>Untitled Page</title><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<br />
< CR:CrystalReportViewer ID="CrystalReportViewer1" Runat="server" AutoDataBind="True"<br />
Height="947px" ReportSourceID="CrystalReportSource1" Width="845px" /><br />
< CR:CrystalReportSource ID="CrystalReportSource1" runat="server"><br />
<Report FileName="CrystalReport1.rpt"><br />
<br />
< /Report><br />
< /CR: CrystalReportSource><br />
<br />
</div><br />
</form><br />
</body><br />
</html><br />
I have read article that say to use the reportdocument class, but i cannot find sny information on how to use this!
Surely there HAS to be a simply way of setting the parameter, something like this: parameter.name.value = "Value"
Anyway any help would be greatly appreciated!
-- modified at 4:50 Tuesday 23rd January, 2007
|
|
|
|
|
date and time picker control to display time only and not date.
|
|
|
|
|
not sure if is this way in 2003 but in 2005, change the format property to 'time'
|
|
|
|
|
I am trying to make a custom control. Should I extend the UserControl Class or should I extend the Button or TextBox or whatever class?
What are the differences of each inheritance?
Can anyone recommend any tips or articles?
Yoshimitsu
|
|
|
|
|
That depends on what you are trying to do.
If you are simply trying to add a need feature to a textbox then it might just be simpler to start by inheriting from TextBox and move on.
If you want to build a textbox with tons of new things that the existing textbox does not do then you may want to start with a blank control and take care of everything yourself.
If you are just building a small enhancement do not overlook building an extender control.
|
|
|
|