Crystal report export to excel : unable to read file - crystal-reports

I am using vb6 program to export a crystal report to excel sheet.After running the program the exported excel sheet is unreadable. getting the error "Unable to read file"
CrxRep.DiscardSavedData
CrxRep.ExportOptions.DestinationType = crEDTDiskFile
CrxRep.ExportOptions.FormatType = crEFTExcel97
'Input parameter set
CrxRep.ExportOptions.DiskFileName = DestName
CrxRep.ExportOptions.ExcelExportAllPages = True
CrxRep.EnableParameterPrompting = False
CrxRep.ExportOptions.ExcelUseWorksheetFunctions = True
CrxRep.ExportOptions.ExcelUseTabularFormat = True
CrxRep.ExportOptions.ExcelPageBreaks = True
CrxRep.ExportOptions.ExcelTabHasColumnHeadings = True
CrxRep.Export False
However this problem occurs only on production server.When I tried to export in dev server it works fine.

From where are you trying to read the file ?
If you are logged onto the server and can't read it, that suggests that Excel or perhaps ADO is not installed on the server, but you can answer that by looking at the icon. If windows recognizes the file type and shows you the Excel icon, then Excel is installed there.
If Excel is installed there, then copy the file to your desktop, or to the dev server, and try to open it there. If it opens there...the problem is likely a missing component ( perhaps ADO ) on the prod server.

Related

Download tableau files from tableau server in a specific Project name folder on your local machine

I am trying to download all the Tableau files from the server on to my local machine .
The below code is downloading the files from a specific folder onto my C://Users/account/
However I want it should create something like below
1.Iterate through all the project names(Tableau server)
2. create a folder on C://Users/Account using the tableau server Project names.
3.Download all the .twb /.twbx files into the respective projects
# First
import tableauserverclient as TSC
import getpass
import os
# Second
user_login = os.getenv('USERNAME')
pw = getpass.getpass('Please enter the password to login to the tableau server\nPassword: ')
# Third
site = 'Global-IT'
server_name = 'http://metrics-it.corp.amazon.com/'
server = TSC.Server(server_name)
server.version = '3.9'
with server.auth.sign_in(TSC.TableauAuth(username=user_login, password=pw, site=site)):
for wb in [w for w in TSC.Pager(server.workbooks)
if w.project_name.startswith('Temporary - To be Decommisioned',)]:
file_path = server.workbooks.download(wb.id)
print(wb.name, ': ', wb.project_name)
print("Successfully downloaded workbook with workbook id: " + wb.id)
print("\nDownloaded the file to {0}.".format(file_path))
print()
print('-------------------------')
print()
Can someone help me with the code.

Error 20599 Cannot open SQL Server using VB6/Crystal report

I have been trying to browse a SQL Server database-based Crystal Reports version 8 with following Visual Basic code:
CrystalReport1.ReportFileName = "C:\Report1.rpt"
CrystalReport1.Destination = crptToWindow
CrystalReport1.DiscardSavedData = True
CrystalReport1.WindowState = crptMaximized
MsgBox "Ok!", vbInformation
CrystalReport1.Action = 1
I am using the Crystal Reports control. The database of the report is ODBC datasource connecting to SQL Server. Without DiscardSavedData this works, but it displays old data. With DiscardSavedData, I get the error message:
Error 20599 Cannot open SQL Server.
How do I solve this problem?
i have solved my issus by adding the connection string CrystalReport1.Connect, i'd like to share my solution for all.
CrystalReport1.ReportFileName = "C:\Report1.rpt"
CrystalReport1.Destination = crptToWindow
CrystalReport1.DiscardSavedData = True
CrystalReport1.Connect ="Data Source=Localhost;UID=sa;PWD=****;DSQ=Dat BdName;"
CrystalReport1.WindowState = crptMaximized
CrystalReport1.Action = 1

phpexcel save file to server ubuntu

I'm with a problem I would like to share to see if I can provide help.
PHP Excel use Ubuntu and want guaradar the file generated in a specific folder of my project directory. I understand that looking information is made as follows, but it is not working properly.
My code is as follows:
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
//header('Content-Disposition: attachment;filename="ReporteSuscriptores.xlsx"');
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
//$objWriter->save('nameoffile.xls');
$filename = (__DIR__);
$objWriter->save($filename . '/report.xlsx');
Try other alternatives without success as the next block
$objWriter->save('nameoffile.xls');
And I can not save the file generated excel in a specific directory

Getting an error while upgrading an MSI application

I'm getting below error while upgrading one software on my Windows 2003 server.
"Error 1260 : Windows cannot open this program because it has been prevented by a software restriction policy. For more information, open event viewer."
I searched lot on internet and one thing I got to know that, this error occurs because of one Windows's security update, KB2918614. I uninstalled that update & tried upgrade of my product, it worked fine for me.
But my question is, without uninstalling that update how I can make my upgrade of software successful ?
Here are some logs that I'm getting while failure :
MSI (s) (E4:24) [10:39:07:097]: SECREPAIR: Hash Database: C:\WINDOWS\Installer\SourceHash{97353D18-281D-42B5-8855-21E08089EFB8}
MSI (s) (E4:24) [10:39:07:128]: SECREPAIR: CryptAcquireContext succeeded
MSI (s) (E4:24) [10:39:07:878]: SECREPAIR: filename: **********.msi Stored Hash Value:+VE6k8PVr******************RjSWBjatbw= Current Hash:jhsyK1CivGh*************V2MlyUZsICUx83w=
MSI (s) (E4:24) [10:39:07:878]: SECREPAIR: UAC not supported and could not take approval from user
MSI (s) (E4:24) [10:39:07:878]: SECUREREPAIR: SecureRepair Failed. Error code: 4ec4E6A3388
Finally I got the answer !!
There is one more update Microsoft provided to get rid from current security update KB2918614. Here is the Microsoft article
In this article they have mentioned some registry changes. After doing those change my issue got resolved. Here are those registry changes :
Locate and then click the following subkey in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer
On the Edit menu, point to New, and then click DWORD Value.
Type SecureRepairPolicy for the name of the DWORD, and then press Enter.
Right-click SecureRepairPolicy, and then click Modify.
In the Value data box, type 2, and then click OK.
Locate and then click the following subkey in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer
On the Edit menu, point to New, and then click Key.
Type SecureRepairWhitelist for the name of the key, and then press Enter.
Double-click the SecureRepairWhitelist key to open it.
On the Edit menu, point to New, and then click String Value. Create String Values that contain the product codes (including braces {}) of the products that have to be added to the Safe Recipients list.

ASP.NET MVC: Can an MSI file be returned via a FileContentResult without breaking the install package?

I'm using this code to return a FileContentResult with an MSI file for the user to download in my ASP.NET MVC controller:
using (StreamReader reader = new StreamReader(#"c:\WixTest.msi"))
{
Byte[] bytes = Encoding.ASCII.GetBytes(reader.ReadToEnd());
return File(bytes, "text/plain", "download.msi");
}
I can download the file, but when I try to run the installer I get an error message saying:
This installation package could not be
opened. Contact the application vendor
to verify that this is a valid Windows
Installer package.
I know the problem isn't C:\WixTest.msi, because it runs just fine if I use the local copy. I don't think I'm using the wrong MIME type, because I can get something similar with just using File.Copy and returning the copied file via a FilePathResult (without using a StreamReader) that does run properly after download.
I need to use the FileContentResult, however, so that I can delete the copy of the file that I'm making (which I can do once I've loaded it into memory).
I'm thinking I'm invalidating the install package by copying or encoding the file. Is there a way to read an MSI file into memory, and to return it via a FileContentResult without corrupting the install package?
Solution:
using (FileStream stream = new FileStream(#"c:\WixTest.msi", FileMode.Open))
{
BinaryReader reader = new BinaryReader(stream);
Byte[] bytes = reader.ReadBytes(Convert.ToInt32(stream.Length));
return File(bytes, "application/msi", "download.msi");
}
Try using binary encoding and content-type application/msi instead of text/plain - it's not ASCII or text content so you're mangling the file.