Can I export a report design layout from Access? - visual-studio-2010

I'm converting an application from access to c#. I have a adp file for the access application. I've only been able to export the report as a .cls file, which does nothing for me. Is there a way to export the report design view so that I don't have to redo it from scratch??
Thanks!

Are you able to use the SaveAsText method to export your report e.g:
saveastext(acReport,"ReportName","FileName.txt")
And then re-import the report using the LoadFromText method e.g:
loadfromtext(acReport,"ReportName","FileName.txt")
This approach allows to export elements from MS Access to a text file containing all the file attributes etc and then allows you to load it back in keeping all it's settings/configurations

Related

Excel cannot open the file because the file format or file extension is not valid - PHP Maatwebsite

In our backend project, we have some features that allows to export files to xlsx.
We have done some tests locally and everything is working fine.
However, I deployed the app in an Azure App Service and some of the exports (not all) are not working fine.
I deployed backend (PHP), frontend (React) and database (MySQL) in Azure. I copied the information of the local DB to the DB deployed in azure (just because we don't wanna waste time with the data).
In the backend project, we are using Laravel with Maatwebsite for the features related to the exports. I created a class that implements FromQuery, WithHeading and ShouldAutoSize and that has construct, query and headings functions. Next, in a Controller, I use this structure to get the file:
public function functionName(Request $request){
$fileName= 'name'.time().'.xlsx';
return (new ClassThatHasTheLogicOfExporting($request->all()))->download($fileName);
}
All my exports works like that, but I'm getting the following error in some of them:
"Excel cannot open the file because the file format or file extension is not valid"
When I try to open the file.
I've been reading about the issue and some people says that I should use ob_start() (at the beggining of the class) and ob_end_clean() (just before exporting the file) but when I do this, I get a 404 error in the web app.
A curious thing is that when I add a filter to the data for exporting (for instance, downloading only the data of people in a specific city) (I can do it in the frontend app), the file opens without errors.
With this strategy, I've achieved downloading all the data in separate groups, so I don't think that the issue is related to special characters in the data.
Does anybody have any suggestion?
I'm using maatwebsite/excel 3.1 and PHP 8 with Laravel 8
I believe the error statement correctly suggests the error is being caused due to an invalid extension. Don’t worry there are several workarounds to this, I am sharing them below:
Method 1 – Change the Default File Format to Save Excel Workbooks
In Excel 2007, click the ‘Microsoft Office’ button and then ‘Excel Options’. In Excel 2010 and higher versions, click File > Options.
Select the Export option.
Select the Change File Type option.
Change the file extension, and then click Save As.
Method 2 – Recover Unsaved Workbook
Go to File and select the Info option.
Under Manage Versions, select ‘Recover Unsaved Workbooks’ op
If MS Excel has unsaved files then, it will list them. You can open and save it.
Method 3 – Use the' Open and Repair' Feature of MS Excel
Open MS Excel application.
Go to File and select the Open option.
Select the corrupt file and choose the Open and Repair option.
You can also check this forum:
https://social.technet.microsoft.com/forums/office/en-US/63020ccc-51d7-46d9-b956-121c0e6efcc8/excel-file-error-the-file-format-and-extension-dont-match?forum=Office2016ITPro
Best Regards,
Steve
you can add the below
if (ob_get_length() == 0 ) {
ob_start();
$response = Excel::download(new KingdomsExport, 'kingdoms.xlsx',\Maatwebsite\Excel\Excel::XLSX);
return $response;
}

How to create a UI.inputbox which prompts for browse path? [SketchUp 8 API]

I have a ruby script for SketchUp 8 which collects data and needs to write it into a csv file. When the code creates the csv file, I want an inputbox to show up which asks for the filename and directory to save too.
Does anyone know how to create an inputbox with the 'browse directory' option?
UI.inputbox is a very simple and limited API method - it only allow textbox input and dropdown selectionbox input as described in the API docs: http://ruby.sketchup.com/UI.html#inputbox-class_method
But there are other methods for opening the file dialogs:
UI.savepanel http://www.sketchup.com/intl/en/developer/docs/ourdoc/ui#savepanel
UI.openpanel http://www.sketchup.com/intl/en/developer/docs/ourdoc/ui#openpanel
There are no further customization offered than what is described in the API docs.
If you need to design you own custom dialog then you have to resort to either webdialogs (http://www.sketchup.com/intl/en/developer/docs/ourdoc/webdialog - https://github.com/thomthom/sketchup-webdialogs-the-lost-manual) or making your own Ruby C Extension and make system calls natively (https://github.com/SketchUp/ruby-c-extension-examples).

Using PDI transformation in Pentaho BI server as data source for report parameters

Any advice on how to use PDI transformation as data source for report parameters in BI server's console?
I've uploaded the prpt reports to BI server but the I get a message "Error parsing parameter information". The .prpt and .ktr files are both in the same directory.
Actually, just realized that the issue could be solved by adding Transformation (KTR) as a resource. In this case, one can use the File-Resources menu selection. In the dialog select the transformation you wish to import and pick text/xml format. Give the resource a name and save it. You must save your PRPT file again (File-Save).
The caveat here is that transformation should be in the same folder as PRPT file. Then in the data sources, don't select transformation via folder path, but use the name of the resource that was assigned during the previous step (there is no drop down menu for looking thorough the files). You have to know exact name of the resource in order to do so.
Check the logs carefully. I suspect it's not finding the KTR. When you select the KTR in the prpt it usually (annoyingly) saves the whole path, so it's probably the full path to the ktr as defined on your dev box.
This does work, so do persevere!

ASP.NET Membership Password Recovery E-mail [duplicate]

I am working on a simple portal application using the ASP.NET membership and login controls. I would like to use the PasswordRecovery control to send emails containing forgotten passwords, however my portal requires localization. I have an existing Content Management System that I am pulling the localized strings out of and I would like to link the PasswordRecovery control to that system.
But, it appears that the PasswordRecovery control will ONLY accept a .txt file for the email body...the property is PasswordRecovery1.MailDefinition.BodyFileName
I do not want to use a file on disk, I would like to use the localized content in my CMS.
Is there any way to do this? It occurred to me that I might be able to use the SendingMail event to send my OWN email through the normal System.Net namespace, but that seems sorta cludgy...
Any thoughts?
Thanks,
Max
Try handling the SendingMail event of the PasswordRecovery control. In that event, set the e.Message.Body and e.Message.Subject properties to your localized text.
Found this by googling "BodyFileName localization":
http://forums.asp.net/t/1118242.aspx:
Just bind the property to a key in
your page's localresource file. The
page's local resource file is the file
located in a subdirectory called
app_localresources in your page's
directory. Just use visual studio's
"tools -> create local resource"
option in design view for it be
created for you.
In that file, create a string
key/value pair with something like
Name: myBodyFileName
Value: myDefaultBodyFile.txt
Then bind this to the BodyFileName
property of the login control with
something like
'>
Then just create the sattelite local
resource files for other cultures and
map that key/value pair in those
resources to other body text files.
By the way, if you used visual studio
to create the resource file for you,
then the binding may have been done
for you automatticaly. Just search for
a
"MyChangePasswordControlResource1.BodyFileName"
key in the resource file or something
similar.
Regards, Jorge

Jasper Reports Save PDF to disk

I'm using Jasper Reports within Spring. Is it possible to let Jasper generate the PDF of the report and save it to the file system?
Of course. In fact, JasperReports includes an export parameter for doing just that. Basically, you setup your exporter however you are doing so now and set the JRExportParameter.OUTPUT_FILE_NAME parameter to the name of the file you want to save the report as, and then export the report as per normal.
You can write the bytes received from JRPdfExporter to a local file instead of the response stream. The exact solution will depend on how you are using Jasper in your application.

Resources