Jul 04, 2014 I have the following code that is in VBA that I would like to convert to Java with equivalent APIs. What I mean is I want the program in Java to behave the same as that of the program in VBA code. What it does is: 1) Open a document. 2) Add a filter variable - this is for sectioning.
Hi,
I have the following code that is in VBA that I would like to convert to Java with equivalent APIs. What I mean is I want the program in Java to behave the same as that of the program in VBA code. What it does is:
1) Open a document.
2) Add a filter variable - this is for sectioning.
3) Add a complex filter - this is to pull the content that belongs to the filtering (i.e employee Id).
4) Save the content to a file based on the filtering value and format.
I have been searching for in this forum to see any APIs that can do the same in Java, but I could not find anything. Currently the VBA code processes Deski doucment and I want to do the same and Webi in Java. Please help. Thanks! Code snippet in VBA enclosed below:
- Java-developers use SpreadsheetConverter to speed up software development. SpreadsheetConverter converts Microsoft Excel spreadsheets into accelerated and compact Java-programs. It can convert your Microsoft Excel spreadsheet into a Java class that calculates just as the spreadsheet.
- Customizable conversion rules. If you want to add the ability to convert new controls or functions or want to change how the conversion is done, you simply change a few simple conversion rules. Runtime Java classes may be distributed royalty free once you purchase the product.
Set myFilterVar = mydoc.DocumentVariables(in_filter_var)
Set myFilterVarValueName = mydoc.DocumentVariables.Add('Value', 'Filter_Value')
If myFilterVar.ValueCount > 0 Then
intNumChoices = UBound(myFilterVar.Values(boUniqueValues))
'collect the number of choices in a variant variable
myFilterChoices = myFilterVar.Values(boUniqueValues)
For i = 1 To intNumChoices
'Get the variable value
strNextValue = Replace(myFilterChoices(i), '', ')
For j = 1 To TabCount
Set myrpt = mydoc.Reports(j)
'build filter
If IsNumeric(myFilterChoices(i)) Then
myrpt.AddComplexFilter myFilterVar, '=<' & myFilterVar.Name & '> = ToNumber(<' & myFilterVarValueName.Name & '>)'
Else
myrpt.AddComplexFilter myFilterVar, '=<' & myFilterVar.Name & '> = ' & '' & strNextValue & ''
End If
myFilterVarValueName.Formula = strNextValue
'recompute the report
myrpt.ForceCompute
Next j
'now export to desired format, using the filter value as part of the name
If g_report_file_type_id = pdf Then
mydoc.SaveAs (lDir & mydoc.Name & '-' & strNextValue & '.pdf')
ElseIf g_report_file_type_id = xls Then
mydoc.SaveAs (lDir & mydoc.Name & '-' & strNextValue & '.xls')
ElseIf g_report_file_type_id = both Then
mydoc.SaveAs (lDir & mydoc.Name & '-' & strNextValue & '.pdf')
mydoc.SaveAs (lDir & mydoc.Name & '-' & strNextValue & '.xls')
End If
Next i
End If
Convert Your SSL Certificate to the Correct Format
Sometimes the Certificate Authority that issued your SSL certificate send it in a file-type that isn't compatible with your server. Fortunately, this can be easily fixed. Whether you're dealing with DER, PKCS#7, P7B, PKCS#12 or PFX format, it's easy to convert.
Convert your SSL Certificate to the Correct File Type
Converting your SSL certificate from one type to another is a super-easy task. You just have to run a few OpenSSL commands and voila!
Need an SSL Certificate?
85% Off Comodo
SSL Certificates
CONVERT FROM PEM FORMAT
Convert PEM to DER
openssl x509 -outform der -in certificate.pem -out certificate.der
Convert PEM to P7B
openssl crl2pkcs7 -nocrl -certfile certificate.cer -out certificate.p7b -certfile CACert.cer
Convert PEM to PFX
openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt -certfile CACert.crt
CONVERT FROM DER FORMAT
DER a binary form of PEM. It has extension .der or .cer. DER is typically used with Java platforms.
Convert DER to PEM
openssl x509 -inform der -in certificate.cer -out certificate.pem
CONVERT FROM PKCS#7 OR P7B FORMAT
P7B formatted file is usually stored in Base64 format and has extension .p7b or .p7c. Files in this format contain lines '-----BEGIN PKCS7-----' and '-----END PKCS7-----'. This format is just for certificates, not for private keys.
PKCS#7 and P7B are installed on Microsoft Windows and Java Tomcat servers.
Convert P7B to PEM
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
Convert P7B to PFX
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.cer
openssl pkcs12 -export -in certificate.cer -inkey privateKey.key -out certificate.pfx -certfile CACert.cer
CONVERT FROM PKCS#12 OR PFX FORMAT
PFX is a binary format storing the server certificate, intermediates certificates, and private key in one file. It usually has the extension .pfx or .p12. Typically, these are used on Windows machines.
Convert Excel Vba Code To Java Code Software - WinSite
When converting PFX format to PEM, one file will include all certificates and the private key.
To separate it, you need to open this file in a simple text editor, copy every single part (with BEGIN and END lines) to different files and save it as certificate.cer, CACert.cer and privatekey.key.
Convert PFX to PEM
Vba To Java Converter Windows 10
openssl pkcs12 -in certificate.pfx -out certificate.cer -nodes