Zip a scheduled report in Cognos - cognos

How to Zip a scheduled csv format report in IBM Cognos. I tried to convert the report into active report and compress it but it produces a .mht file instead of zip.

You could try scheduling the report with a delivery setting of Email along with setting the compression settings on the delivery service as noted here:
https://www.ibm.com/support/knowledgecenter/en/SSEP7J_10.2.2/com.ibm.swg.ba.cognos.ug_cc.10.2.2.doc/t_asg_config_email_attachments.html
If that does not work you could also enable the output to file system and then write a script which takes care of the compression after the fact.
https://www.ibm.com/support/pages/how-save-report-outputs-file-location-report-basis

Related

Sending recently created Sharepoint-file as attachment with Power Automate

After some months I could say I am getting the hang of Microsoft Flow, however I could use some help with the following issue:
In a flow for reporting purposes, a temporary file (.xlsx) is created in a sharepoint folder by means of a template. This temporary file is then filled with rows and info from other sources. So far so good.
I use the body of this newly created and furnished file as an attachment for an e-mail to the chief. However, the attachment came out identical to the (empty) template file, without the rows and furnishing.
Adding a delay of two minutes before attaching and sending the mail solved it for relatively small reports, but this is not ideal as I want it to work regardless of file size. Furthermore I do not understand why it would send an empty (old) version of the temp. file in the first place, as all the furnishing operations should have executed before copying and attaching (the flow is entirely in series).
Sorry for the long story. Does anyone have a more elegant solution than using a Delay-node?

Need to create an Excel file that will have data from two CSV files with PowerShell

I need to create a report that I would like to be in Excel for easier handling of data, but that Excel file needs to get the data from two csv files that are generated every time when my tests are completed ( both csv files contains id, name, timestamp but from different entity). Plan is to have a automated report from my tests in form of Excel.
My plan is to automate this process with PowerShell as I could run these PowerShell scripts and tests inside a pipeline. I haven't got luck so far with importing the data into Excel. I picked up the csv and I can see data via PowerShell output but cant figure it out how to transfer that data into excel via PowerShell. I need to mention that because my firm's policy, I can't install any PowerShell modules ( I found some ImportExcel module that would helped me to achieve what I want but unfortunately I can't use it ). To mention that files are currently on my local machine but plan is that all data will be on server where the tests are run.
So is there a way to import CSV file(s) into Excel sheet via PowerShell?
All best,
D

Get the actual file extension using NiFi

I am using Apache NiFi to ingest data from Azure Storage. Now, the file I want to a huge file (100+ GB) read can have any extension and I want to read the file's header to get its actual extension.
I found python-magic package which uses libmagic to read the file's header to fetch the extension, but this requires the file to be present locally.
The NiFi pipeline to ingest the data looks like this
I need a way to get the file extension in this NiFi pipeline. Is there a way to read the file's header from the Content Repo? If yes, how do we do it? FlowFile has only the metadata which says the content-type as text/plain for a CSV.
There is no such thing as a generic 'header' that all files have that gives you it's "real" extension. A file is just a collection of bits, and we sometimes choose to give extensions/headers/footers/etc so that we know how to interpret those bits.
We tend to add that 'type' information in two ways, via a file extension e.g. .mp4 and/or via some metadata that accompanies the file - this is sometimes a header, which is sometimes plaintext and easily readible, but this is not always true. Additioanlly, it is up to the user and/or the application to set this information, and up the user and/or application to read it - neither of which are a given.
If you do not trust that the file has the proper extension applied (e.g. video.txt when it's actually an mp4) then you could also try to interrogate the metadata that is held in Azure Blob Storage (ContentType) and see what that says - however, this is also up to the user/application to set when the file is uploaded to ABS, so there is no guarantee that it is any more accurate than the file extension.
text/plain is not invalid for a plaintext CSV, as CSVs are just formatted plaintext - similar to JSON. However, you can be more specific and use e.g. text/csv for CSV and application/json for JSON.
NiFi does have IndentifyMimeType which can try to work it out for you by interrogating the file, but it is more complex that just accessing some 'header'. This processor uses Apache Tika for the detection, and adds a mime.type attribute to the FlowFile.
If your file is some kind of custom format, then this processor likely won't help you. If you know your files have a specific header, then you'll need to provide more information for your exact situation.

JMeter jp#gc-WebDriver Sampler — Run the Webpage from MS Excel Spreadsheet

I have the Webpage that need to perform the multi test cases for automation test and currently need to hard code the text variables from WebDriver Sampler by Groovy. And I would like to know that JMETER WebDriver can pickup the data from MS. Excel and performing the test? Like says the I need key in the login page and select the items from dropdown box from the webpage. The next step will be confirm the order by input the Credit Cards information. Thanks.
The easiest is to convert MS Excel file into CSV file, if you're able to do it - you can read the values using CSV Data Set Config
If the file is coming from external location and it's in one of binary formats (.xls or .xlsx) - it's still can be done, but you will have to do some scripting like:
Download tika-app.jar to JMeter Classpath
Restart JMeter to pick the .jar up
Use Apache POI library for reading data from Excel. The code will be different for different file formats and your Excel structure so I can only provide a couple of links with examples and snippets:
Busy Developers' Guide to HSSF and XSSF Features
How to Implement Data Driven Testing in your JMeter Test

Opening xlsx file created with SpreadSheetGear

I have created a simple Excel file using SpreadSheetGear. If I save it as an xls file
workbook.SaveAs("file.xls", SpreadsheetGear.FileFormat.Excel8);
and attach it to an email, I can open it on my phone (tested both with iPhone and Android).
If I save it as an xlsx file
workbook.SaveAs("file.xlsx", SpreadsheetGear.FileFormat.OpenXMLWorkbook);
and attach it to an email, I CANNOT open it on my phone.
If I open the xlsx file attachment on my computer and save it with no changes and attach it to an email, I now can open it on my phone.
Apparently Excel saves the file differently than SSG. The file size of the xlsx file attachment is 9 KB. When I open it on my computer and save it, the new file size is 24 KB.
Some of my users prefer the xlsx format. Is there anything I can do with to make the SSG generated file attachment open like an Excel generated file attachement?
iOS depends on certain attributes being present in the worksheet data of the Open XML file format to properly parse these files. SpreadsheetGear does not write these attributes out because they are listed as optional in the Open XML file format specification and, also, omitting them reduces file size, as you have noted. Excel, for whatever reason, always writes out these optional attributes and other third-party components often times rely on their presence to function correctly. SpreadsheetGear V5 added a workaround to write out these attributes by enabling a certain "Experimental" option. This option was added because the OLE DB provider also exhibits this errant behavior. You might try something like the following and see if this helps in getting SpreadsheetGear to better work with your viewer:
IWorkbookSet workbookSet = Factory.GetWorkbookSet();
workbookSet.Experimental = "OleDbOpenXmlWorkaround";
IWorkbook workbook = workbookSet.Workbooks.Open(#"C:\temp\BadWorkbook.xlsx");
workbook.SaveAs(#"C:\temp\GoodWorkbook.xlsx", FileFormat.OpenXMLWorkbook);
Please see the SpreadsheetGear.IWorkbookSet.Experimental property for more information on this feature.
From what I can tell, iOS/Andriod/etc often also depend on other certain optional features available in the file formats that SpreadsheetGear either doesn't support or write out by default. For instance, iOS depends on a "data cache" stored within charts to display chart series data points and SpreadsheetGear's support for writing out this data cache is limited. This can result in charts not displaying as expected in iOS, Android, etc.

Resources