Solved

ASP -> SL

Posted on 2011-03-10
12
446 Views
Last Modified: 2013-11-12
Hi Experts

I have an ASP page that prints using a third party printing object through its designer, but wondered if i can do this in a SL4? If so what can i do with existing code to transfer in SL.

I have attached the code and 2 screenshots - one of the page and the printed label just to show how the ASP works

Thanks
XCEL-100-SATA-2-5.pdf
ASP-screenshot.docx
ASPSSD.txt
0
Comment
Question by:razza_b
  • 7
  • 5
12 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 35110171
What type of "third party printing object" are you using (ActiveX, C++, ...)?
0
 
LVL 1

Author Comment

by:razza_b
ID: 35115737
We use a designer called TFormer and thats where i create the label, then the names(values) on label is used in code and then the dll is added to solution and i use the objects from that to help do printing, to get the repo name, form name etc.

these are the fields on label and in asp(see attachment)...
          Job.RepositoryName = "<%=TFormerRepository%>"
          Job.ProjectName = "<%=RS("LabelProject")%>"
          Job.FormName = "<%=RS("LabelType")%>"
          Job.PrinterName = ""
          JobData.AddNewRecord() // add a new record. Each record prints the Detail Band of the form
          Jobdata.SetDataField "PartNumber","<%=RS("PartNumber")%>"
          Jobdata.SetDataField "SerialNumber","<%=RS("Serial")%>"
          Jobdata.SetDataField "CustomerSerialNumber","<%=RS("CPN")%>"
          Jobdata.SetDataField "CustDesc","<%=REPLACE(RS("CustomerDesc"),CHR(34),"")%>"
          Jobdata.SetDataField "WWNumber","<%=RS("WWN")%>"
          Jobdata.SetDataField "COO","<%=RS("COO")%>"
          Jobdata.SetDataField "Model","<%=RS("SmartModel")%>"
          Jobdata.SetDataField "WorkOrder","<%=RS("WorkOrder")%>"
          Jobdata.SetDataField "CPN","<%=RS("CustomerModel")%>"
          Jobdata.SetDataField "Revision","<%=RS("CustomerRev")%>"
          Jobdata.SetDataField "Firmware","<%=RS("Firmware")%>"
          Jobdata.SetDataField "Capacity","<%=RS("Capacity")%>"
          Jobdata.SetDataField "Interface","<%=RS("Interface")%>"
          Jobdata.SetDataField "DOM","<%=RS("DOM")%>"


Thanks
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 35116695
I haven't heard of TFormer, but if it is ActiveX, you need to do something special to work with ActiveX, such as creating an HTML page, with a reference to the ActiveX control.
0
 
LVL 1

Author Comment

by:razza_b
ID: 35117057
I could get TFormer working myself its just the rest of the code in the asp page i want to use in SL if its possible.

Would it be possible to use/modify code into SL?

0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 500 total points
ID: 35118316
I am not sure what you mean by "the rest of the code"...I don't think that you can use ASP classic code in Silverlight, unmodified, so you would need to re-engineer as .NET code.
0
 
LVL 1

Author Comment

by:razza_b
ID: 35120114
i mean tformer not a problem(designer & dll), the"rest of the code" what i have shown you can it be easily re-engineered in SL?

so i can basically use this in the xaml.cs(obviously modified for c#)....

// db connection here

<%IF Len(SerialNumber) > 1 THEN
        SQL="EXECUTE wsp_PrintSSDProductLabel '" & SerialNumber  & "'"
        'RETURNS : Plant,WorkOrder,Serial,WWN,CPN,CustomerRev,DOM,PartNumber,CustomerModel,CustomerDesc,SmartModel,Capacity,Interface,Firmware,Coo,LabelType,LabelProject,PrintFlag

        RS.Open(SQL)
                'Print Labels
        Sub PrintLabel()
          set Job = window.TF.CreateJob()
          set JobData = Job.NewJobDataRecordSet()
          TF.License "Modular Technologies, Inc.",3,2,"A34AB63D4F7CAFD40E6969220DDC9"
         Job.RepositoryName = "<%=TFormerRepository%>"
         Job.ProjectName = "<%=RS("LabelProject")%>"
          Job.FormName = "<%=RS("LabelType")%>"
          Job.PrinterName = ""
          JobData.AddNewRecord() // add a new record. Each record prints the Detail Band of the form
          Jobdata.SetDataField "PartNumber","<%=RS("PartNumber")%>"
          Jobdata.SetDataField "SerialNumber","<%=RS("Serial")%>"
          Jobdata.SetDataField "CustomerSerialNumber","<%=RS("CPN")%>"
          Jobdata.SetDataField "CustDesc","<%=REPLACE(RS("CustomerDesc"),CHR(34),"")%>"
          Jobdata.SetDataField "WWNumber","<%=RS("WWN")%>"
          Jobdata.SetDataField "COO","<%=RS("COO")%>"
          Jobdata.SetDataField "Model","<%=RS("SmartModel")%>"
          Jobdata.SetDataField "WorkOrder","<%=RS("WorkOrder")%>"
          Jobdata.SetDataField "CPN","<%=RS("CustomerModel")%>"
          Jobdata.SetDataField "Revision","<%=RS("CustomerRev")%>"
          Jobdata.SetDataField "Firmware","<%=RS("Firmware")%>"
          Jobdata.SetDataField "Capacity","<%=RS("Capacity")%>"
          Jobdata.SetDataField "Interface","<%=RS("Interface")%>"
          Jobdata.SetDataField "DOM","<%=RS("DOM")%>"

          Job.PrintForm()

        End Sub
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 35121438
The code looks pretty straightforward, with lines to set properties, and call the PrintForm method.

What does NewJobDataRecordSet represent in this line?

set JobData = Job.NewJobDataRecordSet()

Open in new window

   

Is it an ADO classic Recordset object?    
0
 
LVL 1

Author Comment

by:razza_b
ID: 35121514
yes it an ADO classic Recordset object, but i think i know what ive to do should be striaght foward, just wanted someone's opinion about taking asp to SL, but your right its just .net code, i was thinking SL would need to have something similar in xaml to asp.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 35121667
This wouldn't be XAML, since that is declarative definition for a control.  That code would need to go in the code-behind xaml.cs file.  .NET can work with ADO classic Recordset object, if that is what the TFormer control uses.  This should be achievable in Silverlight, if that is all you are looking for.
0
 
LVL 1

Author Comment

by:razza_b
ID: 35126851
yeah ok, once i get the dll into SL project this should be fine (but also refereing to other post about tformer dll), will update asap.
0
 
LVL 1

Author Comment

by:razza_b
ID: 35189403
Added a SL class library and created classes for the third party dll to be written in C# code for the purposes of printing with SL.
0
 
LVL 1

Author Closing Comment

by:razza_b
ID: 35189428
This is what i had to do to get third party printing dll that was written in .net to be able to work within SL
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Memory Usage 2 49
Unable to upgrade to .Net 4.6.2 on Server 2012r2 2 42
Resolve Dependency Issues 4 42
Word Directory is not in the drop down list 4 24
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now