I’ve trouble outputting order data to excel. I’ve regexed bolded values and currently order numbers go to their separate Excel columns as i want. First order to B1> next order to C1 etc.
Under these order numbers i have BIR numbers outputting correctly. First one B2, second C2 etc. But then how can i get Kund Material nr and their amount (1-54st) listed under the same Order column in excel? Difference is that these might have multiple values in same order.
Under we have output from a single PDF invoice.
Order: 123456 skapad 2019.10.28 Ert order nr.: 123456
Leveransnr.: 12345678 BIR: 12345 Kund-material nr.: 123456789 11 st 1.234,00 SEK Kund-material nr.: 987654321 40 st 1.234,00 SEK Kund-material nr.: 123459876 54 st 1.234,00 SEK
Order: 654321 skapad 2019.11.20 Ert order nr.: 123456
Leveransnr.: 12345678 BIR: 54321
Kund-material nr.: 123567891
1 st 1.234,00 SEK
Order: 987654 skapad 2019.11.20 Ert order nr.: 123456
Leveransnr.: 12345678 BIR: 54321
Kund-material nr.: 123567891
1 st 1.234,00 SEK
Order: 789654 skapad 2019.11.20 Ert order nr.: 123456
Leveransnr.: 12345678 BIR: 54321
Kund-material nr.: 123567891
1 st 1.234,00 SEK
Kund-material nr.: 987654321
40 st 1.234,00 SEK
Kund-material nr.: 123459876
54 st 1.234,00 SEK
I’ve done the splitting of Orders with PdfInvoice.Split({“Order:”},StringSplitOptions.None) and it is working well. Like mentioned i’m already getting Order No and BIR no from the loop. But when it comes to rest of the values i’ve trouble getting them sorted correctly to Excel columns.
Ok my problem description was not maybe best one but i managed to tackle this by switching from “for” to “while” loop +counter when matching values. This way i could tag all the details from single order field with regex and throw this sequence next to for loop to make it purr…
Unfortunately i cannot. There’s client information in xaml- files. But in pseudocode. First we read PDF, then we go to while loop where counter is set according to amount of my orders. In a loop we have all the needed Regex- matches activities. After this we go each Regex through in a for- loop to print values to Excel. My For- loops are also inside the first while. I know, not the most elegant design, but works!