Start by providing a clear and complete description of the problem. Include the complete error message, and the relevant parts of your code. Remember to indicate which line of code the error relates to.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
i m using this code to print crystal report with out priview ,Some Time Load Report Faild Error Show ,when i close and reopen application again report will printed,how can i resolve this error please guide me,my code is
<pre> Dim crtableLogoninfo AsNew TableLogOnInfo
Dim crConnectionInfo AsNew ConnectionInfo
Dim CrTables As Tables
' Dim CrTable As TableDim TableCounter
Dim crReportDocument AsNew ReportDocument
Dim crParameterDiscreteValue As ParameterDiscreteValue
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldLocation As ParameterFieldDefinition
Dim crParameterValues As ParameterValues
Dim billno AsNew InfoGeneration
Dim sname As ConfigurationSettings
crReportDocument.Load(Application.StartupPath & "\Reports\rptsinv.rpt")
.ServerName = sname.AppSettings("servername")
.DatabaseName = sname.AppSettings("dbname")
.UserID = sname.AppSettings("username")
.Password = sname.AppSettings("password")
CrTables = crReportDocument.Database.Tables
ForEach CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
crParameterFieldDefinitions = crReportDocument.DataDefinition.ParameterFields
crParameterFieldLocation = crParameterFieldDefinitions.Item("s_id")
crParameterValues = crParameterFieldLocation.CurrentValues
crParameterDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
crParameterDiscreteValue.Value = txts_id.Text
crReportDocument.PrintToPrinter(txtcopies.Text, False, 0, 0)
This is an update. This question is no longer an issue. I found information
about implementing the Verbs() function of the ControlDesigner. Sorry
for the inconvenience. Did not know if I should delete this question or not.
The code below adds an action to select 1 of 2 panel configurations:
"SelectPanel2Type" or "SelectPanel3Type".
The controls action list displays the current 'PanelType' selection.
When you click on the current item, the current item text changes to the second panel
Example: If "SelectPanel2Type" is displayed, clicking on it changes to "SelectPanel3Type"
and visa versa.
This functions as expected.
The action is also displayed and can be selected from the attributes panel of the Properties window, but when I click on the action in the attributes panel, the text in the attributes
panel does not change to the opposite panel and I cannot select the opposite configuration.
If "Select Panel2Type" is displayed, when I click on it, the action is performed in
the control, but the text in the attributes panel does not change to "Select Panel3Type".
If I deselect the control and reselect it, the attributes panel will be updated
to "Select Panel3Type".
Is there something that I am not doing to update the attributes panel correctly?
Friend Class SPCActionList
' Host object
Private HostControl As SplitPanelCtrl = Nothing
' Cache a reference to the DesignerActionUIService host.
Private _DesignerActionUIService As DesignerActionUIService
Public Sub New(ByVal component As IComponent)
' Cache a reference to the control.
HostControl = DirectCast(component, SplitPanelCtrl)
' Cache a reference to update action
_DesignerActionUIService = CType(GetService(GetType(DesignerActionUIService)), DesignerActionUIService)
Public Overrides Function GetSortedActionItems() As DesignerActionItemCollection
Dim items As New DesignerActionItemCollection()
Private Sub SelectPanel2Type()
Private Sub SelectPanel3Type()
I am working on a project where an access database calls a batch file that then calls a .vbs file. Within the .vbs file my code is to open a telnet session, connect to my companies warehouse management system, login, call a specific program, enter some information on the screen which executes the program, then logout.
This is where it gets interesting. If I manually run the batch file which is on my local C:\ drive the batch file calls the .vbs script and the .vbs script executes flawlessly. Keep in mind that the point of this is to automate and not have a person manually run the batch file or do everything that the .vbs script is setup to do. When I use a Microsoft Access macro to open the same exact batch file which then calls the .vbs script I run into problems. The batch file executes as expected, the .vbs script opens the command prompt however I get a message that telnet does not exist. How is this possible? The access database is on my local C:\ drive along with the batch file and .vbs script.
Here is my .vbs code which I know is not the problem since it will work when I run it manually. Does using a program to call telnet interact differently or cause security issues within Microsoft windows?
My .vbs file code (for security purposes I changed/put server, username, password, program name,file name instead of real values):
I tried full path to cmd.exe
C:\windows\system32\cmd.exe and get same result.
Why would the script work when running it manually via a double click of the .vbs file however when using a program such as outlook or access to run the same exact .vbs file results in an error "telnet not recognized".....error
No, he was referring to the full path for Telnet, which is "C:\Windows\System32\Telnet.exe".
Also, using SendKeys is not recommended. What if the user clicks another window or the system pops up a dialog from something else in the middle of all those key strokes you're sending? Bad things will happen.
The better way to do it would be to redirect the Input stream of the CMD Process you launched and write your data to the stream instead.
System.ItDidntWorkException: Something didn't work as expected.
Duh....lol....i tried the full path for telnet.exe and run into a similar problem as cmd.exe. i input the commands and server and it now it doesnt connect when using a program to execute the .vbs however if i manually execute my .vbs it works.
Im not concerned with the sendkeys because this script will be running at a time when no one will be accessing the pc.
If it's telling you telnet.exe is a "Bad command or filename", it's because it can't find the executable on whatever the PATH environment is set to. This may be different from what you see when you type SET PATH at a CMD prompt yourself. That's why you have to specify the entire path to telnet.exe in the .VBS file.
System.ItDidntWorkException: Something didn't work as expected.
I have created a control similar to the SplitContainer with a host control
and 2 custom panels. All controls inherit ParentControlDesigner. I have a
custom splitter control to separate the panels.
Problem: When I resize the panels using the splitter control, the 'designer border'
that surrounds the selected panel does not resize for the selected control.
This border is drawn by the designer; not my code. Is there a way to refresh
the designer so it will redraw the border of the selected control?
If the code I gave to you not helped you to solve that problem you should show us your actual ParentControlDesigner and the part of your control which is responsible for the painting to help you with the modification.
I was hoping there would be a function call that would cause the designer
to re-select the selected child panel which would then redraw the designer's border.
According to another post, there is not.
Since I am new to control design and this control is for my personal use, I can live
with this imperfection in my code for now.
I do not know how to mark this question as no longer relevant but if there is
a box or something I am suppose to select, please let me know.
I'm not sure if I understood you in the right way ... but independent from that : have you see that I posted a code-replay too in this question ?
I'm very sure that all what you want to have is to (nearly) realizable like you want to have.
Also I'm very familiar with Control-Design and most of the environment around - so I'm sure that I could help you. Give it a try and help me to help you ...
Last Visit: 9-Aug-20 5:39 Last Update: 9-Aug-20 5:39