Reading Drool Rules from multiple Sheets in one Excel - jboss

I am trying to read multiple sheets rules from one excel sheet.
I used kieFileSystem.write(ResourceFactory.newClassPathResource("{path of excel sheet}"));
But it is reading from only 1st sheet i.e Rules-1 how to read rules form sheet2 also into same session while loading one excel sheet.
Below attached the excel with 2 sheets format.

Drools decision tables do not support multiple sheets in a single workbook. As you found, if you try to provide multiple sheets, it will only read the first.
The solution is to use multiple workbooks.

Drools always read the first sheet, so you need to swap your sheet before the kieFileSystem.write()
XSSFWorkbook workbook = new XSSFWorkbook("file path");
workbook.setSheetOrder(code,0);
workbook.setActiveSheet(0);//to make sure everything is fine
File outputFile = new File("tempExcel"+".xlsx");
FileOutputStream fos = new FileOutputStream(outputFile);
workbook.write(fos);
workbook.close();
fos.close();
//here do your kieFileSystem.write(outputFile)

Related

Excel to Smart Sheets

I am need to convert my Excel sheet into Smartsheet. I tries to upload the document from Excel and Google Sheets but tbe formulas do not transfer. How can I create new formulas in Smartsheet that correspond with the formula in Excel or Google Sheet. How do I determine the new formulas for Smartsheet?
When you import into smartsheet, you have to select the checkbox to keep formulas from your excel file.
checkbox to keep formulas

OpenXML: update Embedded excel in Word document

I am updating word template with data run time using OpenXML. My question is after entering cell values in embedded Excel, it is not reflecting when I open the word document after process.
e.g. I have one word template document which has total 6 embedded Excel object. Each embedded Excel has three worksheets (e.g. display, data & settings). Once I have data while running application, the code is filling the value in data worksheet. The Display worksheet shows the value from Data worksheet based on Formulas applied on cells on display worksheet. Once entire process completes I opened newly generated word document, it shows Excel Display worksheet without the values applied. If I will edit/open worksheet from Word document than it get refreshed and showing new values.
Is there way in OpenXML to fix this issue?

How to Load multiple excel sheets data to the same table in SSIS?

I am bit confused on my business scenario and need your's valuable suggestion to go ahead .
I got one excel work book template from the client and it is having 8 sheets and 250 columns and each sheet having different columns and there is no relationship from one sheet to other sheet in terms of column names (one sheet has 60 columns with 5000 rows and other sheet has 10 columns with 200 rows ) as well as data also .
I Need to load this data into single table using SSIS ?
Our client confirmed there will not be change in their inputs ?
Here are steps for ur scenario
1- create a table which has all the columns in excel sheets. If column names are repeating on multiple sheets. You will have one time in your table.
1- bring data flow task. Bring excel source. Make connection to ur excel. Choose sheet1 and then bring oledb destination and map input columns to table. If the column names in table will b same in ur sheet. They will map automatically.
2- bring second data flow. Bring excel souce. Use existing excel source n choose sheet2. Get oledb dest n map to ur destination table.
Get third data flow n load third sheet. Repeat for ur all sheets.

How to combine multiple excel data into one excel with all sheets?

Actually I have a list of customers from all the countries in one sheet name "ALL".
Problem: I have to crate separate sheets for group of countries like for USA sheet name will be USA and for Australia,Germany and Switzerland sheet name will be Central_Region output will be like below image.
What I have tried till now :- I used tFilterRow component and I have got all the separate excel files group by countries . now trying to combine in one file.
For Example : I have 5 excel workbook files each has one sheet like excel1.xls has sheet "USA" other excel2.xls has sheet "Canada" and same other 3 are in same way.
Now I want to generate a single excel workbook which will have all the sheets like "USA", "Canada" and all other sheets from other excels.
I tried using iUnite but it did not help it just append all the sheets data into one sheet.Like below image
Download this add-ins
Open one your excel file and then open this add-ins file (also you can install that)
when you open this file, select Enable Macro.
Go to DATA tab on excel file and select RDB Merge add-in.
set properties and push Merge Button.
With this, your excel fills will merge in one sheet.
If you can't know in which order row will appear, you could store your data in csv files for each country.
Then you can add each csv file into a separate sheet on the Excel file using Write after.
If rows are coming in the rigth order, like all USA then Canada etc . . . you can directly use Write after in your ExcelOutput behind your tFilter but i highly suppose this is not the case.
If you have same structure excel file with different in sheet name then you have to make job like this.
tFileList---tFileInputExcel-----tMap---tFileOuputExcel
Set source directory where you get all the files to the tFileList component.
Use global varibale which hold "file with path" information and assign to the file name text box of tFileInputExcel component.
In select Sheet box assign index instead sheet name.
check Append property of tFileOuputExcel component you can merge all files in single one.
Note: in tMap you can add transformation or make changes in column sequence of output.

Tableau Workbooks Error

I have 3 Tableau workbooks and 1 work book is a fact table and rest two are tables related to the previous one I need to fetch them into one workbook and make charts using all three tables data. I am unable to fetch all three workbooks into single workbook to work with all 3 of them.
I have .tab files with one fact table and 2 dimension tables in .tab files and I need to use all three files and make charts using that data
Based on the Tableau Desktop documentation, you could
Copy and paste selected sheets to another workbook.
Import a saved workbook into your current workbook.
Export selected sheets to a new workbook.
If you've got an older version of Tableau, such as 8.0, then try using bookmarks